Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android application instance not created

Tags:

android

I have an app which works on almost all devices. I have thousands of installations, no crashes. Now I have a friend who has a new Nexus 5 with Kit-kat. He uninstalled my app and installed it again. Now it crashes on every start.

It crashes because the start activity in its onCreate() method tries to access the application object which I have derived. But getApplication() does not return my instance of Application which I have defined in AndroidManifest.xml.

I have put some logs into the constructor and into the onCreate() method of my custom Application class. And these logs are not called. But only on this one phone!

Any ideas when an Application object is not created?

like image 498
Witek Avatar asked Feb 11 '14 07:02

Witek


People also ask

What is an instance in Android?

What is an instance? In object-oriented programming (OOP), an instance is a specific realization of any object. An object may be different in several ways, and each realized variation of that object is an instance. The creation of a realized instance is called instantiation.

Can I use jQuery in Android?

A Touch-Optimized Web Framework jQuery Mobile is a HTML5-based user interface system designed to make responsive web sites and apps that are accessible on all smartphone, tablet and desktop devices.

What is android label for?

The android:label is to define your app name, which is display in the installed application list. android:name The fully qualified name of an Application subclass implemented for the application.

What is the use of activity tag?

Use with the <activity> tag to supply a default banner for a specific activity, or with the <application> tag to supply a banner for all application activities. The system uses the banner to represent an app in the Android TV home screen.


1 Answers

Restarting the phone solves the problem.

Seams to be a bug in Android.

like image 190
Witek Avatar answered Sep 27 '22 18:09

Witek