Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

176
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!