Get password from android account - android

I noticed from Android API, they have this method getPassword(Account account).
accountManager = AccountManager.get(this);
Account[] allGoogleAccounts = accountManager.getAccountsByType("com.google");
for (Account account : allGoogleAccounts)
{
System.out.println(accountManager.getPassword(account));
}
But I have this error:
11-16 10:49:08.986: WARN/System.err(5732): java.lang.SecurityException: caller uid 10039 is different than the authenticator's uid
11-16 10:49:09.038: WARN/System.err(5732): at android.os.Parcel.readException(Parcel.java:1247)
11-16 10:49:09.038: WARN/System.err(5732): at android.os.Parcel.readException(Parcel.java:1235)
11-16 10:49:09.045: WARN/System.err(5732): at android.accounts.IAccountManager$Stub$Proxy.getPassword(IAccountManager.java:415)
11-16 10:49:09.087: WARN/System.err(5732): at android.accounts.AccountManager.getPassword(AccountManager.java:277)
11-16 10:49:09.087: WARN/System.err(5732): at com.test.account.onCreate(account.java:30)
11-16 10:49:09.107: WARN/System.err(5732): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
11-16 10:49:09.107: WARN/System.err(5732): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
11-16 10:49:09.125: WARN/System.err(5732): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
11-16 10:49:09.125: WARN/System.err(5732): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
11-16 10:49:09.134: WARN/System.err(5732): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
11-16 10:49:09.156: WARN/System.err(5732): at android.os.Handler.dispatchMessage(Handler.java:99)
11-16 10:49:09.156: WARN/System.err(5732): at android.os.Looper.loop(Looper.java:123)
11-16 10:49:09.166: WARN/System.err(5732): at android.app.ActivityThread.main(ActivityThread.java:4627)
11-16 10:49:09.175: WARN/System.err(5732): at java.lang.reflect.Method.invokeNative(Native Method)
11-16 10:49:09.185: WARN/System.err(5732): at java.lang.reflect.Method.invoke(Method.java:521)
11-16 10:49:09.185: WARN/System.err(5732): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
11-16 10:49:09.195: WARN/System.err(5732): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
11-16 10:49:09.206: WARN/System.err(5732): at dalvik.system.NativeStart.main(Native Method)
Anyone can tell me my mistake?

From AccountManager.getPassword()
getPassword:
This method requires the caller to hold the permission AUTHENTICATE_ACCOUNTS and to have the same UID as the account's authenticator.
The way I see it you can only get the password if your app was the app that created the account in account manager (Could be mistaking though)

in account manager if you(your app) write the account then only you(your app) can get the password this is because of security that on app could get the password of the user that he used to sync in other app
you can get the password of the account the is created by your process UID every process have it own UID once it runs on the device and continue to have the same UID ever

Related

Application crashes using multidex and google play services

This is my first application. I tried to add Admob which requires google play services and Multidex support So I added those projects also.
My application is running fine in Android 5.1 but crashing in Android 3.2
I understand the error as it is trying to load some classes but not finding them in google play services (I think so don't know exactly).
android minSdkVersion="13"
android targetSdkVersion="21"
How can I fix ?
Logcat:
11-16 08:31:44.365: E/dalvikvm(392): Could not find class 'android.app.Notification$BigTextStyle', referenced from method com.google.android.gms.common.GooglePlayServicesUtil.zza
11-16 08:31:44.457: E/dalvikvm(392): Could not find class 'android.os.UserManager', referenced from method com.google.android.gms.common.GooglePlayServicesUtil.zzap
11-16 08:31:44.465: E/dalvikvm(392): Could not find class 'android.app.AppOpsManager', referenced from method com.google.android.gms.common.GooglePlayServicesUtil.zzb
11-16 08:31:44.815: E/dalvikvm(392): Could not find class 'com.google.android.gms.ads.internal.overlay.zzc', referenced from method com.google.android.gms.ads.internal.overlay.zzl.zza
11-16 08:31:44.835: E/dalvikvm(392): Could not find class 'android.support.v4.util.SimpleArrayMap', referenced from method com.google.android.gms.ads.internal.zzq.<init>
11-16 08:31:44.945: E/dalvikvm(392): Could not find class 'com.google.android.gms.internal.zzbk', referenced from method com.google.android.gms.internal.zzig.zzG
11-16 08:31:45.155: E/AndroidRuntime(392): FATAL EXCEPTION: main
11-16 08:31:45.155: E/AndroidRuntime(392): java.lang.NoClassDefFoundError: android.support.v4.util.SimpleArrayMap
11-16 08:31:45.155: E/AndroidRuntime(392): at com.google.android.gms.ads.internal.zzq.<init>(Unknown Source)
11-16 08:31:45.155: E/AndroidRuntime(392): at com.google.android.gms.ads.internal.zzq.<init>(Unknown Source)
11-16 08:31:45.155: E/AndroidRuntime(392): at com.google.android.gms.ads.internal.zzb.<init>(Unknown Source)
11-16 08:31:45.155: E/AndroidRuntime(392): at com.google.android.gms.ads.internal.zzc.<init>(Unknown Source)
11-16 08:31:45.155: E/AndroidRuntime(392): at com.google.android.gms.ads.internal.zzf.<init>(Unknown Source)
11-16 08:31:45.155: E/AndroidRuntime(392): at com.google.android.gms.ads.internal.client.zze.zza(Unknown Source)
11-16 08:31:45.155: E/AndroidRuntime(392): at com.google.android.gms.ads.internal.client.zzz.zzdb(Unknown Source)
11-16 08:31:45.155: E/AndroidRuntime(392): at com.google.android.gms.ads.internal.client.zzz.zzda(Unknown Source)
11-16 08:31:45.155: E/AndroidRuntime(392): at com.google.android.gms.ads.internal.client.zzz.zza(Unknown Source)
11-16 08:31:45.155: E/AndroidRuntime(392): at com.google.android.gms.ads.BaseAdView.loadAd(Unknown Source)
11-16 08:31:45.155: E/AndroidRuntime(392): at com.google.android.gms.ads.AdView.loadAd(Unknown Source)
11-16 08:31:45.155: E/AndroidRuntime(392): at file_handler.bep_file_handle_activity.display_add(bep_file_handle_activity.java:78)
11-16 08:31:45.155: E/AndroidRuntime(392): at file_handler.bep_file_handle_activity.onCreate(bep_file_handle_activity.java:53)
11-16 08:31:45.155: E/AndroidRuntime(392): at android.app.Activity.performCreate(Activity.java:4397)
11-16 08:31:45.155: E/AndroidRuntime(392): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1048)
11-16 08:31:45.155: E/AndroidRuntime(392): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1779)
11-16 08:31:45.155: E/AndroidRuntime(392): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1831)
11-16 08:31:45.155: E/AndroidRuntime(392): at android.app.ActivityThread.access$500(ActivityThread.java:122)
11-16 08:31:45.155: E/AndroidRuntime(392): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1024)
11-16 08:31:45.155: E/AndroidRuntime(392): at android.os.Handler.dispatchMessage(Handler.java:99)
11-16 08:31:45.155: E/AndroidRuntime(392): at android.os.Looper.loop(Looper.java:132)
11-16 08:31:45.155: E/AndroidRuntime(392): at android.app.ActivityThread.main(ActivityThread.java:4123)
11-16 08:31:45.155: E/AndroidRuntime(392): at java.lang.reflect.Method.invokeNative(Native Method)
11-16 08:31:45.155: E/AndroidRuntime(392): at java.lang.reflect.Method.invoke(Method.java:491)
11-16 08:31:45.155: E/AndroidRuntime(392): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
11-16 08:31:45.155: E/AndroidRuntime(392): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
11-16 08:31:45.155: E/AndroidRuntime(392): at dalvik.system.NativeStart.main(Native Method)
11-16 08:31:51.885: E/dalvikvm(392): Could not find class 'android.support.v4.util.ArrayMap', referenced from method com.google.android.gms.common.api.GoogleApiClient$Builder.<init>
11-16 08:31:51.955: E/dalvikvm(392): Could not find class 'android.support.v4.util.ArrayMap', referenced from method com.google.android.gms.common.api.GoogleApiClient$Builder.zzoI
To add google play services library, you shouldn't copy jar file to your project; You should import google play services library project to your project. How?
Copy whole google play services to your workspace. (google play services library project path is:
/extras/google/google_play_services/libproject/google-play-services_lib
Import google play services library to your project. Right click on your android project. Goto properties. Choose Android on the left panel. Click on Add and browse the library project. Select the same. Click ok and apply
To add some jar to your project:
Copy jar file to libs folder
Right click on your android project. Goto properties. Choose Java Build Path on the left panel. on Libraries tab, press "Add jars..." button and browse for added jar file, then apply and ok.
UPDATE:
To add multidex support to your project:
How to enable multidexing with the new Android Multidex support library
Please add latest support library v4.
To add support library v4 automatically:
In eclipse: Right click on your android project -> Android tools -> Add support library.

Restlet Android doesn't connect to oData service

I just can't get Restlet on Android to work. I have the same jars, same generated classes etc. that I use in plain Java (it works there). Problem seems to be with the HttpClientHelper.
I also read this: http://wiki.restlet.org/docs_2.1/13-restlet/275-restlet/266-restlet.html.
Here's my code:
import netflix.catalog.v2.Genre;
import org.restlet.engine.Engine;
import org.restlet.ext.net.HttpClientHelper;
import org.restlet.ext.odata.Query;
Engine.getInstance().getRegisteredClients().clear();
Engine.getInstance().getRegisteredClients().add(new HttpClientHelper(null));
SystemDataObjectsService service = new SystemDataObjectsService();
Query<Genre> query = service.createGenreQuery("/Genres");
for (Genre g : query) {
Log.d(TAG, g.getName());
}
Here's the trace:
11-16 13:02:31.915: I/org.restlet(1344): Starting the HTTP client
11-16 13:02:31.924: I/org.restlet(1344): A recoverable error was detected (1001), attempting again in 2000 ms.
11-16 13:02:33.935: I/org.restlet(1344): A recoverable error was detected (1001), attempting again in 2000 ms.
11-16 13:02:35.955: E/org.restlet(1344): Can't get the metadata for http://odata.netflix.com/v2/Catalog/ (response's status: Communication Error (1001) - The connector failed to complete the communication with the server)
11-16 13:02:35.965: W/org.restlet(1344): Can't parse the content of http://odata.netflix.com/v2/Catalog/Genres
11-16 13:02:35.965: W/org.restlet(1344): java.lang.Exception: Can't execute the query without the service's metadata.
11-16 13:02:35.965: W/org.restlet(1344): at org.restlet.ext.odata.Query.execute(Query.java:350)
11-16 13:02:35.965: W/org.restlet(1344): at org.restlet.ext.odata.Query.iterator(Query.java:645)
11-16 13:02:35.965: W/org.restlet(1344): at net.ascorbin.locaspo.MainActivity$LoginTask.doInBackground(MainActivity.java:74)
11-16 13:02:35.965: W/org.restlet(1344): at net.ascorbin.locaspo.MainActivity$LoginTask.doInBackground(MainActivity.java:1)
11-16 13:02:35.965: W/org.restlet(1344): at android.os.AsyncTask$2.call(AsyncTask.java:264)
11-16 13:02:35.965: W/org.restlet(1344): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
11-16 13:02:35.965: W/org.restlet(1344): at java.util.concurrent.FutureTask.run(FutureTask.java:137)
11-16 13:02:35.965: W/org.restlet(1344): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:208)
11-16 13:02:35.965: W/org.restlet(1344): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
11-16 13:02:35.965: W/org.restlet(1344): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
11-16 13:02:35.965: W/org.restlet(1344): at java.lang.Thread.run(Thread.java:856)
11-16 13:02:35.965: W/dalvikvm(1344): threadid=11: thread exiting with uncaught exception (group=0x409c01f8)
I also tried to import org.restlet.ext.httpclient.HttpClientHelper (and any other HttpClientHelper that Eclipse suggests) which lead to a slightly different trace:
11-16 13:06:27.775: I/org.restlet(1446): Get the metadata for http://odata.netflix.com/v2/Catalog/ at http://odata.netflix.com/v2/Catalog/$metadata
11-16 13:06:27.815: I/org.restlet(1446): Starting the HTTP client
11-16 13:06:27.836: W/org.restlet(1446): An error occurred during the communication with the remote HTTP server.
11-16 13:06:27.836: W/org.restlet(1446): java.net.UnknownHostException: Unable to resolve host "odata.netflix.com": No address associated with hostname
11-16 13:06:27.836: W/org.restlet(1446): at java.net.InetAddress.lookupHostByName(InetAddress.java:400)
11-16 13:06:27.836: W/org.restlet(1446): at java.net.InetAddress.getAllByNameImpl(InetAddress.java:242)
11-16 13:06:27.836: W/org.restlet(1446): at java.net.InetAddress.getAllByName(InetAddress.java:220)
11-16 13:06:27.836: W/org.restlet(1446): at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:137)
11-16 13:06:27.836: W/org.restlet(1446): at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164)
11-16 13:06:27.836: W/org.restlet(1446): at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119)
11-16 13:06:27.836: W/org.restlet(1446): at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:360)
11-16 13:06:27.836: W/org.restlet(1446): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)
11-16 13:06:27.836: W/org.restlet(1446): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)
11-16 13:06:27.836: W/org.restlet(1446): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465)
11-16 13:06:27.836: W/org.restlet(1446): at org.restlet.ext.httpclient.internal.HttpMethodCall.sendRequest(HttpMethodCall.java:335)
11-16 13:06:27.836: W/org.restlet(1446): at org.restlet.engine.http.adapter.ClientAdapter.commit(ClientAdapter.java:120)
11-16 13:06:27.836: W/org.restlet(1446): at org.restlet.engine.http.HttpClientHelper.handle(HttpClientHelper.java:113)
11-16 13:06:27.836: W/org.restlet(1446): at org.restlet.Client.handle(Client.java:180)
11-16 13:06:27.836: W/org.restlet(1446): at org.restlet.resource.ClientResource.handle(ClientResource.java:944)
11-16 13:06:27.836: W/org.restlet(1446): at org.restlet.resource.ClientResource.handle(ClientResource.java:912)
11-16 13:06:27.836: W/org.restlet(1446): at org.restlet.resource.ClientResource.handle(ClientResource.java:867)
11-16 13:06:27.836: W/org.restlet(1446): at org.restlet.resource.ClientResource.handle(ClientResource.java:892)
11-16 13:06:27.836: W/org.restlet(1446): at org.restlet.resource.ClientResource.handle(ClientResource.java:801)
11-16 13:06:27.836: W/org.restlet(1446): at org.restlet.resource.ClientResource.get(ClientResource.java:544)
11-16 13:06:27.836: W/org.restlet(1446): at org.restlet.ext.odata.Service.getMetadata(Service.java:483)
11-16 13:06:27.836: W/org.restlet(1446): at org.restlet.ext.odata.Query.<init>(Query.java:232)
11-16 13:06:27.836: W/org.restlet(1446): at org.restlet.ext.odata.Service.createQuery(Service.java:277)
11-16 13:06:27.836: W/org.restlet(1446): at net.ascorbin.locaspo.SystemDataObjectsService.createGenreQuery(SystemDataObjectsService.java:87)
11-16 13:06:27.836: W/org.restlet(1446): at net.ascorbin.locaspo.MainActivity$LoginTask.doInBackground(MainActivity.java:71)
11-16 13:06:27.836: W/org.restlet(1446): at net.ascorbin.locaspo.MainActivity$LoginTask.doInBackground(MainActivity.java:1)
11-16 13:06:27.836: W/org.restlet(1446): at android.os.AsyncTask$2.call(AsyncTask.java:264)
11-16 13:06:27.836: W/org.restlet(1446): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
11-16 13:06:27.836: W/org.restlet(1446): at java.util.concurrent.FutureTask.run(FutureTask.java:137)
11-16 13:06:27.836: W/org.restlet(1446): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:208)
11-16 13:06:27.836: W/org.restlet(1446): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
11-16 13:06:27.836: W/org.restlet(1446): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
11-16 13:06:27.836: W/org.restlet(1446): at java.lang.Thread.run(Thread.java:856)
11-16 13:06:27.836: I/org.restlet(1446): A recoverable error was detected (1001), attempting again in 2000 ms.
I don't know what else to do, if someone has a running Restlet/ oData android project, perhaps he/ she can give me a hint?

Unable to load .so file in android with github bump demo

I hav downloaded bump demo from github but when i am running this its craching all the time with error log as
11-16 12:33:01.632: ERROR/AndroidRuntime(4298): FATAL EXCEPTION: main
11-16 12:33:01.632: ERROR/AndroidRuntime(4298): java.lang.UnsatisfiedLinkError: Library
android-api not found 11-16 12:33:01.632: ERROR/AndroidRuntime(4298): at
java.lang.Runtime.loadLibrary(Runtime.java:461)
11-16 12:33:01.632: ERROR/AndroidRuntime(4298): at
java.lang.System.loadLibrary(System.java:557)
11-16 12:33:01.632: ERROR/AndroidRuntime(4298): at com.bump.api.BumpAPI.<init>
(BumpAPI.java:122)
11-16 12:33:01.632: ERROR/AndroidRuntime(4298): at
java.lang.Class.newInstanceImpl(Native Method)
11-16 12:33:01.632: ERROR/AndroidRuntime(4298): at
java.lang.Class.newInstance(Class.java:1429)
11-16 12:33:01.632: ERROR/AndroidRuntime(4298): at
android.app.ActivityThread.handleCreateService(ActivityThread.java:2940)
11-16 12:33:01.632: ERROR/AndroidRuntime(4298): at
android.app.ActivityThread.access$3300(ActivityThread.java:125)
11-16 12:33:01.632: ERROR/AndroidRuntime(4298): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:2087)
11-16 12:33:01.632: ERROR/AndroidRuntime(4298): at
android.os.Handler.dispatchMessage(Handler.java:99)
11-16 12:33:01.632: ERROR/AndroidRuntime(4298): at
android.os.Looper.loop(Looper.java:123)
11-16 12:33:01.632: ERROR/AndroidRuntime(4298): at
android.app.ActivityThread.main(ActivityThread.java:4627)
11-16 12:33:01.632: ERROR/AndroidRuntime(4298): at
java.lang.reflect.Method.invokeNative(Native Method)
11-16 12:33:01.632: ERROR/AndroidRuntime(4298): at
java.lang.reflect.Method.invoke(Method.java:521)
11-16 12:33:01.632: ERROR/AndroidRuntime(4298): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
11-16 12:33:01.632: ERROR/AndroidRuntime(4298): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
11-16 12:33:01.632: ERROR/AndroidRuntime(4298): at
dalvik.system.NativeStart.main(Native Method)
while i am using this bloack of code for loading it in onCreate
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
try {
//System.loadLibrary("mysharedlibrary");
//crashing on this line
System.loadLibrary("libgifflen.so");
} catch (UnsatisfiedLinkError use) {
Log.e("JNI", "WARNING: Could not load libmysharedlibrary.so");
System.out.println("warning "+use.getMessage());
}
//.......some other code
}
I think i am missing something very string thing but i am unable to find any such thing or unable to get something for this
This is how I have imported the bump-library to my project and it works.
Import in your eclipse the bump-api-library project
Select the bump-api-library > Properties > Android > Make sure the "Is Library" is selected > Click "Apply" then "OK"
Select your project > Properties > Android > Click the "Add" button > select the "bump-api-library" > Click "Apply" then "OK"

App stopped unexpectedly when exited

My application stopped unexpectedly when I pressed the back button and needed to be forced closed. Here's the error log:
11-16 14:57:34.595: E/AndroidRuntime(4899): FATAL EXCEPTION: main
11-16 14:57:34.595: E/AndroidRuntime(4899): java.lang.IllegalStateException
11-16 14:57:34.595: E/AndroidRuntime(4899): at android.media.MediaPlayer.getDuration(Native Method)
11-16 14:57:34.595: E/AndroidRuntime(4899): at com.example.musicshare.AndroidBuildingMusicPlayerActivity$1.run(AndroidBuildingMusicPlayerActivity.java:337)
11-16 14:57:34.595: E/AndroidRuntime(4899): at android.os.Handler.handleCallback(Handler.java:587)
11-16 14:57:34.595: E/AndroidRuntime(4899): at android.os.Handler.dispatchMessage(Handler.java:92)
11-16 14:57:34.595: E/AndroidRuntime(4899): at android.os.Looper.loop(Looper.java:123)
11-16 14:57:34.595: E/AndroidRuntime(4899): at android.app.ActivityThread.main(ActivityThread.java:3691)
11-16 14:57:34.595: E/AndroidRuntime(4899): at java.lang.reflect.Method.invokeNative(Native Method)
11-16 14:57:34.595: E/AndroidRuntime(4899): at java.lang.reflect.Method.invoke(Method.java:507)
11-16 14:57:34.595: E/AndroidRuntime(4899): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:847)
11-16 14:57:34.595: E/AndroidRuntime(4899): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:605)
11-16 14:57:34.595: E/AndroidRuntime(4899): at dalvik.system.NativeStart.main(Native Method)
What could be the problem?
See your log:
11-12 14:21:20.080: E/AndroidRuntime(8843): android.content.ActivityNotFoundException: Unable to find explicit activity class {com.example.musicshare/com.example.musicshare.ZoneActivity}; have you declared this activity in your AndroidManifest.xml?
You have not declared ZoneActivity on your Android Manifest.. open your Android Manifest and add:
<activity android:name=".ZoneActivity" />
That's the information that is interesting for you:
Unable to find explicit activity class com.example.musicshare/com.example.musicshare.ZoneActivity}; have you declared this activity in your AndroidManifest.xml?
It seems like the Activity that is defined within your manifest does not exist in your code.

Using ViewGroup throws NullPointerException

Does anyone have a clue what could be causing this?
11-16 16:23:26.745: ERROR/AndroidRuntime(9549): Uncaught handler: thread main exiting due to uncaught exception
11-16 16:23:26.765: ERROR/AndroidRuntime(9549): java.lang.NullPointerException
11-16 16:23:26.765: ERROR/AndroidRuntime(9549): at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:692)
11-16 16:23:26.765: ERROR/AndroidRuntime(9549): at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:692)
11-16 16:23:26.765: ERROR/AndroidRuntime(9549): at android.view.ViewRoot.performTraversals(ViewRoot.java:722)
11-16 16:23:26.765: ERROR/AndroidRuntime(9549): at android.view.ViewRoot.handleMessage(ViewRoot.java:1658)
11-16 16:23:26.765: ERROR/AndroidRuntime(9549): at android.os.Handler.dispatchMessage(Handler.java:99)
11-16 16:23:26.765: ERROR/AndroidRuntime(9549): at android.os.Looper.loop(Looper.java:123)
11-16 16:23:26.765: ERROR/AndroidRuntime(9549): at android.app.ActivityThread.main(ActivityThread.java:4363)
11-16 16:23:26.765: ERROR/AndroidRuntime(9549): at java.lang.reflect.Method.invokeNative(Native Method)
11-16 16:23:26.765: ERROR/AndroidRuntime(9549): at java.lang.reflect.Method.invoke(Method.java:521)
11-16 16:23:26.765: ERROR/AndroidRuntime(9549): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:862)
11-16 16:23:26.765: ERROR/AndroidRuntime(9549): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620)
11-16 16:23:26.765: ERROR/AndroidRuntime(9549): at dalvik.system.NativeStart.main(Native Method)
This error used to show up in our crash reports with some regularity. It was very difficult to track down, but in the end we discovered that we sometimes triggered code that removed a view from the view hierarchy from surfaceDestroyed() (the callback method from SurfaceHolder). If your app is using a SurfaceView, make sure you don't do anything to modify the view hierarchy in surfaceDestroyed().

Categories

Resources