Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

177
Visualizações
attempt to invoke gettime on a null object reference

I am trying to get the time of today's date at 11:59 in milliseconds using a timestamp. This is what I have tried. Now this code is working fine in one device but not in the other. It gives the error

 E/test: printstacktrace
                                                            java.text.ParseException: Unparseable date: "29/04/2017 11:59:59 PM" (at offset 20)
                                                                at java.text.DateFormat.parse(DateFormat.java:579)
                                                                at curieo.android.zenmaster.mainfragments.HomeFragment$8.onDataChange(HomeFragment.java:723)
                                                                at com.google.android.gms.internal.zzbmz.zza(Unknown Source)
                                                                at com.google.android.gms.internal.zzbnz.zzYj(Unknown Source)
                                                                at com.google.android.gms.internal.zzboc$1.run(Unknown Source)
                                                                at android.os.Handler.handleCallback(Handler.java:739)
                                                                at android.os.Handler.dispatchMessage(Handler.java:95)
                                                                at android.os.Looper.loop(Looper.java:152)
                                                                at android.app.ActivityThread.main(ActivityThread.java:5497)
                                                                at java.lang.reflect.Method.invoke(Native Method)
                                                                at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
                                                                at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

.

  String currentDate = questiondateFormat.format(new Date(timeStampLong));
            SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy hh:mm:ss a");

            Date d = null;
            try {
                d = sdf.parse(currentDate + " " + "11:59:59 PM");
            } catch (ParseException e) {
                e.printStackTrace();
            }
            Calendar c = Calendar.getInstance();
            c.setTime(d);

            long time = c.getTimeInMillis();

            long difference = time - timeStampLong;
            countDownTimer.start(difference);
over 4 years ago · Santiago Trujillo
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda