Twitter apllication gets closed when open through other application in android using intent object to share data to the twitter


#1

Hi,
I want to share text to twitter application through pass intent object in the code it open twitter application in device then its force close . I am unable to find a solution of it .please help
following is the code which i have done

ShareCompat.IntentBuilder builder = ShareCompat.IntentBuilder.from(myActivity.this);
builder.setSubject(“testing”).setText("testing)).setType(“text/plain”);
Intent i = builder.getIntent();
startActivity(i);

I have got following exceptions when twitter application is open

06-20 02:10:49.205: E/AndroidRuntime(15402): java.lang.RuntimeException: Unable to destroy activity {com.twitter.android/com.twitter.android.PostActivity}: java.lang.NullPointerException 06-20 02:10:49.205: E/AndroidRuntime(15402): at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3112) 06-20 02:10:49.205: E/AndroidRuntime(15402): at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:3130) 06-20 02:10:49.205: E/AndroidRuntime(15402): at android.app.ActivityThread.access$1200(ActivityThread.java:123) 06-20 02:10:49.205: E/AndroidRuntime(15402): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1180) 06-20 02:10:49.205: E/AndroidRuntime(15402): at android.os.Handler.dispatchMessage(Handler.java:99) 06-20 02:10:49.205: E/AndroidRuntime(15402): at android.os.Looper.loop(Looper.java:137) 06-20 02:10:49.205: E/AndroidRuntime(15402): at android.app.ActivityThread.main(ActivityThread.java:4424) 06-20 02:10:49.205: E/AndroidRuntime(15402): at java.lang.reflect.Method.invokeNative(Native Method) 06-20 02:10:49.205: E/AndroidRuntime(15402): at java.lang.reflect.Method.invoke(Method.java:511) 06-20 02:10:49.205: E/AndroidRuntime(15402): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784) 06-20 02:10:49.205: E/AndroidRuntime(15402): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551) 06-20 02:10:49.205: E/AndroidRuntime(15402): at dalvik.system.NativeStart.main(Native Method) 06-20 02:10:49.205: E/AndroidRuntime(15402): Caused by: java.lang.NullPointerException 06-20 02:10:49.205: E/AndroidRuntime(15402): at com.twitter.android.PostActivity.onDestroy(Twttr:739) 06-20 02:10:49.205: E/AndroidRuntime(15402): at android.app.Activity.performDestroy(Activity.java:4656) 06-20 02:10:49.205: E/AndroidRuntime(15402): at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1079) 06-20 02:10:49.205: E/AndroidRuntime(15402): at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3099)