I am trying to integrate Twitter in my Application. I want a pop-up to be shown in which the user can enter his tweet.
Now when the user is already logged in, the application is working fine, but if the user needs to log-in first then the applications opens the twitter web-interface of login. From there, I am not able to come back to my application and show the 'enter-tweet' popup.
Please help.
Exception:
04-02 00:16:53.511: ERROR/AndroidRuntime(5992): java.lang.RuntimeException: Unable to resume activity {mad.android.MyTwitterApp/mad.android.MyTwitterApp.AndroidTwitterSample}: java.lang.NullPointerException
04-02 00:16:53.511: ERROR/AndroidRuntime(5992): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3128)
04-02 00:16:53.511: ERROR/AndroidRuntime(5992): at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3143)
04-02 00:16:53.511: ERROR/AndroidRuntime(5992): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2059)
04-02 00:16:53.511: ERROR/AndroidRuntime(5992): at android.os.Handler.dispatchMessage(Handler.java:99)
04-02 00:16:53.511: ERROR/AndroidRuntime(5992): at android.os.Looper.loop(Looper.java:123)
04-02 00:16:53.511: ERROR/AndroidRuntime(5992): at android.app.ActivityThread.main(ActivityThread.java:4627)
04-02 00:16:53.511: ERROR/AndroidRuntime(5992): at java.lang.reflect.Method.invokeNative(Native Method)
04-02 00:16:53.511: ERROR/AndroidRuntime(5992): at java.lang.reflect.Method.invoke(Method.java:521)
04-02 00:16:53.511: ERROR/AndroidRuntime(5992): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:871)
04-02 00:16:53.511: ERROR/AndroidRuntime(5992): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:629)
04-02 00:16:53.511: ERROR/AndroidRuntime(5992): at dalvik.system.NativeStart.main(Native Method)
Related
I am trying to run very simple program which start with:
MainActivity extends UnityPlayerActivity {
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
But on the on create i get this error:
04-02 09:38:39.227: E/AndroidRuntime(32578): Device fingerprint: samsung/GT-I9100/GT-I9100:4.1.2/JZO54K/I9100XWLSW:user/release-keys
04-02 09:38:39.227: E/AndroidRuntime(32578): Caused by:java.lang.ExceptionInInitializerError
04-02 09:38:39.227: E/AndroidRuntime(32578): at com.unity3d.player.UnityPlayerActivity.onCreate(Unknown Source)
04-02 09:38:39.227: E/AndroidRuntime(32578): at com.example.t.MainActivity.onCreate(MainActivity.java:17)
04-02 09:38:39.227: E/AndroidRuntime(32578): at android.app.Activity.performCreate(Activity.java:5206)
04-02 09:38:39.227: E/AndroidRuntime(32578): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1094)
04-02 09:38:39.227: E/AndroidRuntime(32578): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2074)
04-02 09:38:39.227: E/AndroidRuntime(32578): Caused by: java.lang.UnsatisfiedLinkError: Couldn't load main: findLibrary returned null
04-02 09:38:39.227: E/AndroidRuntime(32578): at java.lang.Runtime.loadLibrary(Runtime.java:365)
04-02 09:38:39.227: E/AndroidRuntime(32578): at java.lang.System.loadLibrary(System.java:535)
04-02 09:38:39.227: E/AndroidRuntime(32578): at com.unity3d.player.UnityPlayer.<clinit>(Unknown Source)
I use compiler 1.6 and took the jar - classes.jar from the unity folder
What can be wrong?
I think the problem is in the manifest.
Come here and follow the instructions!
If I am using the Vibrator.vibrate(long) on an LG-E370 this is causing frequent application restarts. The vibrator permission has been added to the manifest and the vibrator vibrates up to 5 times before the app is restarting.
How can I vibrate reliably?
I added the output of a stacktrace to my onPause() and this is what I get:
04-02 14:39:36.384: dalvik.system.VMStack.getThreadStackTrace(Native Method)
04-02 14:39:36.384: java.lang.Thread.getStackTrace(Thread.java:737)
04-02 14:39:36.384: com.evotegra.aCoDriver.ACoDriverActivity.onPause(ACoDriverActivity.java:94)
04-02 14:39:36.384: android.app.Activity.performPause(Activity.java:3851)
04-02 14:39:36.384: android.app.Instrumentation.callActivityOnPause(Instrumentation.java:1191)
04-02 14:39:36.424: android.app.ActivityThread.performNewIntents(ActivityThread.java:1747)
04-02 14:39:36.424: android.app.ActivityThread.handleNewIntent(ActivityThread.java:1757)
04-02 14:39:36.424: android.app.ActivityThread.access$2300(ActivityThread.java:117)
04-02 14:39:36.424: android.app.ActivityThread$H.handleMessage(ActivityThread.java:989)
04-02 14:39:36.424: android.os.Handler.dispatchMessage(Handler.java:99)
04-02 14:39:36.434: android.os.Looper.loop(Looper.java:130)
04-02 14:39:36.434: android.app.ActivityThread.main(ActivityThread.java:3740)
04-02 14:39:36.434: java.lang.reflect.Method.invokeNative(Native Method)
04-02 14:39:36.434: java.lang.reflect.Method.invoke(Method.java:507)
04-02 14:39:36.444: com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:880)
04-02 14:39:36.444: com.android.internal.os.ZygoteInit.main(ZygoteInit.java:638)
04-02 14:39:36.444: dalvik.system.NativeStart.main(Native Method)
04-02 14:39:44.351: dalvik.system.VMStack.getThreadStackTrace(Native Method)
04-02 14:39:44.371: java.lang.Thread.getStackTrace(Thread.java:737)
04-02 14:39:44.371: com.evotegra.aCoDriver.ACoDriverActivity.onPause(ACoDriverActivity.java:94)
04-02 14:39:44.371: android.app.Activity.performPause(Activity.java:3851)
04-02 14:39:44.381: android.app.Instrumentation.callActivityOnPause(Instrumentation.java:1191)
04-02 14:39:44.381: android.app.ActivityThread.performPauseActivity(ActivityThread.java:2356)
04-02 14:39:44.381: android.app.ActivityThread.performPauseActivity(ActivityThread.java:2326)
04-02 14:39:44.381: android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:2818)
04-02 14:39:44.401: android.app.ActivityThread.access$1600(ActivityThread.java:117)
04-02 14:39:44.401: android.app.ActivityThread$H.handleMessage(ActivityThread.java:946)
04-02 14:39:44.411: android.os.Handler.dispatchMessage(Handler.java:99)
04-02 14:39:44.411: android.os.Looper.loop(Looper.java:130)
04-02 14:39:44.411: android.app.ActivityThread.main(ActivityThread.java:3740)
04-02 14:39:44.462: java.lang.reflect.Method.invokeNative(Native Method)
04-02 14:39:44.462: java.lang.reflect.Method.invoke(Method.java:507)
04-02 14:39:44.462: com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:880)
04-02 14:39:44.482: com.android.internal.os.ZygoteInit.main(ZygoteInit.java:638)
04-02 14:39:44.492: dalvik.system.NativeStart.main(Native Method)
04-02 14:39:44.772: W/ServerManager(8731): <!>com.evotegra.aCoDriver.data.ServerManager$ConnectionManager 559<!> Connection thread was interrupted. Message: null
04-02 14:39:44.862: dalvik.system.VMStack.getThreadStackTrace(Native Method)
04-02 14:39:44.862: java.lang.Thread.getStackTrace(Thread.java:737)
04-02 14:39:44.862: com.evotegra.aCoDriver.ACoDriverActivity.onPause(ACoDriverActivity.java:94)
04-02 14:39:44.862: android.app.Activity.performPause(Activity.java:3851)
04-02 14:39:44.862: android.app.Instrumentation.callActivityOnPause(Instrumentation.java:1191)
04-02 14:39:44.862: android.app.ActivityThread.performPauseActivity(ActivityThread.java:2356)
04-02 14:39:44.862: android.app.ActivityThread.performPauseActivity(ActivityThread.java:2326)
04-02 14:39:44.862: android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:2818)
04-02 14:39:44.872: android.app.ActivityThread.access$1600(ActivityThread.java:117)
04-02 14:39:44.872: android.app.ActivityThread$H.handleMessage(ActivityThread.java:946)
04-02 14:39:44.872: android.os.Handler.dispatchMessage(Handler.java:99)
04-02 14:39:44.872: android.os.Looper.loop(Looper.java:130)
04-02 14:39:44.872: android.app.ActivityThread.main(ActivityThread.java:3740)
04-02 14:39:44.872: java.lang.reflect.Method.invokeNative(Native Method)
04-02 14:39:44.872: java.lang.reflect.Method.invoke(Method.java:507)
04-02 14:39:44.872: com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:880)
04-02 14:39:44.872: com.android.internal.os.ZygoteInit.main(ZygoteInit.java:638)
04-02 14:39:44.872: dalvik.system.NativeStart.main(Native Method)
04-02 14:39:48.315: dalvik.system.VMStack.getThreadStackTrace(Native Method)
04-02 14:39:48.315: java.lang.Thread.getStackTrace(Thread.java:737)
04-02 14:39:48.315: com.evotegra.aCoDriver.ACoDriverActivity.onPause(ACoDriverActivity.java:94)
04-02 14:39:48.315: android.app.Activity.performPause(Activity.java:3851)
04-02 14:39:48.315: android.app.Instrumentation.callActivityOnPause(Instrumentation.java:1191)
04-02 14:39:48.325: android.app.ActivityThread.performPauseActivity(ActivityThread.java:2356)
04-02 14:39:48.335: android.app.ActivityThread.performPauseActivity(ActivityThread.java:2326)
04-02 14:39:48.345: android.app.ActivityThread.handlePauseActivity(ActivityThread.java:2306)
04-02 14:39:48.345: android.app.ActivityThread.access$1700(ActivityThread.java:117)
04-02 14:39:48.345: android.app.ActivityThread$H.handleMessage(ActivityThread.java:953)
04-02 14:39:48.355: android.os.Handler.dispatchMessage(Handler.java:99)
04-02 14:39:48.355: android.os.Looper.loop(Looper.java:130)
04-02 14:39:48.355: android.app.ActivityThread.main(ActivityThread.java:3740)
04-02 14:39:48.355: java.lang.reflect.Method.invokeNative(Native Method)
04-02 14:39:48.375: java.lang.reflect.Method.invoke(Method.java:507)
04-02 14:39:48.375: com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:880)
04-02 14:39:48.375: com.android.internal.os.ZygoteInit.main(ZygoteInit.java:638)
04-02 14:39:48.385: dalvik.system.NativeStart.main(Native Method)
I'm using the Action bar sherlock library in my application and I currently have one two tabs as fragments:
Tab A : Users views information in a list
Tab B : Users can log into facebook
I need the onActivityResult() to handle Facebook sessions in Tab B so I have this code in my Main Activity :
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
Session.getActiveSession().onActivityResult(this, requestCode, resultCode, data);
}
However, this creates this error log when i press the Back Button in Tab A:
04-02 19:46:07.488: E/AndroidRuntime(1380): FATAL EXCEPTION: main
04-02 19:46:07.488: E/AndroidRuntime(1380): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=65537, result=0, data=null} to activity {com.example.chartviewer/com.example.chartviewer.MainActivity}: java.lang.NullPointerException
04-02 19:46:07.488: E/AndroidRuntime(1380): at android.app.ActivityThread.deliverResults(ActivityThread.java:3141)
04-02 19:46:07.488: E/AndroidRuntime(1380): at android.app.ActivityThread.handleSendResult(ActivityThread.java:3184)
04-02 19:46:07.488: E/AndroidRuntime(1380): at android.app.ActivityThread.access$1100(ActivityThread.java:130)
04-02 19:46:07.488: E/AndroidRuntime(1380): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1243)
04-02 19:46:07.488: E/AndroidRuntime(1380): at android.os.Handler.dispatchMessage(Handler.java:99)
04-02 19:46:07.488: E/AndroidRuntime(1380): at android.os.Looper.loop(Looper.java:137)
04-02 19:46:07.488: E/AndroidRuntime(1380): at android.app.ActivityThread.main(ActivityThread.java:4745)
04-02 19:46:07.488: E/AndroidRuntime(1380): at java.lang.reflect.Method.invokeNative(Native Method)
04-02 19:46:07.488: E/AndroidRuntime(1380): at java.lang.reflect.Method.invoke(Method.java:511)
04-02 19:46:07.488: E/AndroidRuntime(1380): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
04-02 19:46:07.488: E/AndroidRuntime(1380): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
04-02 19:46:07.488: E/AndroidRuntime(1380): at dalvik.system.NativeStart.main(Native Method)
04-02 19:46:07.488: E/AndroidRuntime(1380): Caused by: java.lang.NullPointerException
04-02 19:46:07.488: E/AndroidRuntime(1380): at com.example.chartviewer.MainActivity.onActivityResult(MainActivity.java:91)
04-02 19:46:07.488: E/AndroidRuntime(1380): at android.app.Activity.dispatchActivityResult(Activity.java:5192)
04-02 19:46:07.488: E/AndroidRuntime(1380): at android.app.ActivityThread.deliverResults(ActivityThread.java:3137)
04-02 19:46:07.488: E/AndroidRuntime(1380): ... 11 more
Any idea how to handle this?
iam beginner in Android programming...
iam adding Fragments into a Layout using the following codes
Fragment f=new Jobcat();
FragmentManager fm=getSupportFragmentManager();
FragmentTransaction ft =fm.beginTransaction();
ft.add(R.id.jobcategoryfragment, f,"A");
ft.commit();
ft.add(R.id.jobcategoryfragment, f,"C");
ft.commit();
ft.add(R.id.jobcategoryfragment, f,"B");
ft.commit();
and iam removing the Fragment using the following code..
Fragment f = getSupportFragmentManager().findFragmentByTag("B");
FragmentTransaction ft=getSupportFragmentManager().beginTransaction();
ft.remove(f);
ft.commit();
It's working well if the screen orientation is not changed...if i changed the screen orientation or even if i got back orientation to orginal state after that iam getting runtime error
04-02 17:02:23.051: W/dalvikvm(8937): threadid=1: thread exiting with uncaught exception (group=0x41082930)
04-02 17:02:23.051: E/AndroidRuntime(8937): FATAL EXCEPTION: main
04-02 17:02:23.051: E/AndroidRuntime(8937): java.lang.NullPointerException
04-02 17:02:23.051: E/AndroidRuntime(8937): at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:651)
04-02 17:02:23.051: E/AndroidRuntime(8937): at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1444)
04-02 17:02:23.051: E/AndroidRuntime(8937): at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:429)
04-02 17:02:23.051: E/AndroidRuntime(8937): at android.os.Handler.handleCallback(Handler.java:725)
04-02 17:02:23.051: E/AndroidRuntime(8937): at android.os.Handler.dispatchMessage(Handler.java:92)
04-02 17:02:23.051: E/AndroidRuntime(8937): at android.os.Looper.loop(Looper.java:137)
04-02 17:02:23.051: E/AndroidRuntime(8937): at android.app.ActivityThread.main(ActivityThread.java:5041)
04-02 17:02:23.051: E/AndroidRuntime(8937): at java.lang.reflect.Method.invokeNative(Native Method)
04-02 17:02:23.051: E/AndroidRuntime(8937): at java.lang.reflect.Method.invoke(Method.java:511)
04-02 17:02:23.051: E/AndroidRuntime(8937): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
04-02 17:02:23.051: E/AndroidRuntime(8937): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
04-02 17:02:23.051: E/AndroidRuntime(8937): at dalvik.system.NativeStart.main(Native Method)
can anyone help me for finding a solution for this problem...
Thank you
The NullPointerException occurs because the fragment may no longer be added to your activity after the configuration change. This happens if the Fragment is not retained during configuration changes.
You have two options:
In your Jobcat-Fragment add setRetained(true); to your onCreate() method. With this your fragment will survive the Orientation Change and be readded to your activity with the same TAG as before. This is not recommended to do with fragments having a GUI to avoid leakages, but sometimes I found there was no other convenient way to achieve this.
Check if
Fragment f = getSupportFragmentManager().findFragmentByTag("B") -> null
If so there is no need to remove the fragment from your activity because it isn't there anymore anyway.
please add
android:configChanges="orientation|keyboardHidden|screenSize"
in the androidmanifest.xml where the current activity is described...
Recently, I have updated Android SDK with Latest Tools(Rev. 17). I am using Pahonegap 1.3.0
When I am loading page, I am not getting anything on emulator and got the below error
> 04-02 18:49:31.312: W/dalvikvm(1689): Unable to resolve superclass of
> Lcom/src/test1/Test1Activity; (4) 04-02 18:49:31.362:
> W/dalvikvm(1689): Link of class 'Lcom/src/test1/Test1Activity;' failed
> 04-02 18:49:31.362: D/AndroidRuntime(1689): Shutting down VM 04-02
> 18:49:31.402: W/dalvikvm(1689): threadid=1: thread exiting with
> uncaught exception (group=0x409c01f8) 04-02 18:49:31.522:
> E/AndroidRuntime(1689): FATAL EXCEPTION: main 04-02 18:49:31.522:
> E/AndroidRuntime(1689): java.lang.RuntimeException: Unable to
> instantiate activity
> ComponentInfo{com.src.test1/com.src.test1.Test1Activity}:
> java.lang.ClassNotFoundException: com.src.test1.Test1Activity 04-02
> 18:49:31.522: E/AndroidRuntime(1689): at
> android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1880)
> 04-02 18:49:31.522: E/AndroidRuntime(1689): at
> android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
> 04-02 18:49:31.522: E/AndroidRuntime(1689): at
> android.app.ActivityThread.access$600(ActivityThread.java:123) 04-02
> 18:49:31.522: E/AndroidRuntime(1689): at
> android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
> 04-02 18:49:31.522: E/AndroidRuntime(1689): at
> android.os.Handler.dispatchMessage(Handler.java:99) 04-02
> 18:49:31.522: E/AndroidRuntime(1689): at
> android.os.Looper.loop(Looper.java:137) 04-02 18:49:31.522:
> E/AndroidRuntime(1689): at
> android.app.ActivityThread.main(ActivityThread.java:4424) 04-02
> 18:49:31.522: E/AndroidRuntime(1689): at
> java.lang.reflect.Method.invokeNative(Native Method) 04-02
> 18:49:31.522: E/AndroidRuntime(1689): at
> java.lang.reflect.Method.invoke(Method.java:511) 04-02 18:49:31.522:
> E/AndroidRuntime(1689): at
> com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
> 04-02 18:49:31.522: E/AndroidRuntime(1689): at
> com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551) 04-02
> 18:49:31.522: E/AndroidRuntime(1689): at
> dalvik.system.NativeStart.main(Native Method) 04-02 18:49:31.522:
> E/AndroidRuntime(1689): Caused by: java.lang.ClassNotFoundException:
> com.src.test1.Test1Activity 04-02 18:49:31.522:
> E/AndroidRuntime(1689): at
> dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
> 04-02 18:49:31.522: E/AndroidRuntime(1689): at
> java.lang.ClassLoader.loadClass(ClassLoader.java:501) 04-02
> 18:49:31.522: E/AndroidRuntime(1689): at
> java.lang.ClassLoader.loadClass(ClassLoader.java:461) 04-02
> 18:49:31.522: E/AndroidRuntime(1689): at
> android.app.Instrumentation.newActivity(Instrumentation.java:1023)
> 04-02 18:49:31.522: E/AndroidRuntime(1689): at
> android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1871)
> 04-02 18:49:31.522: E/AndroidRuntime(1689): ... 11 more
You are getting a class not found exception :
java.lang.ClassNotFoundException: com.src.test1.Test1Activity
It's not bundle in your apk, or obfuscated, or not in your manifest.
I just had the same issue. My problem was that the name of the file and class in the source folder did not match package name in manifest.
I solved this by adding a new class with the correct name.
1: Figure out your package: com.apps.sampleApp
Note the name of the end class, in this case sampleApp
2: In source make sure that three is sampleApp.java in src/com.apps.sampleApp
IF YES
make sure the public class is sampleApp
IF NO
There is another file here that extends DroidGap. Copy this to sampleApp.java and change the public class name to sampleApp
Hope that helps others, it solved the issue for me.