Android error Dx trouble writing output:already prepared - android

I am building an app using Smack . After running app in Eclipse emulator the apk gets installed successfully but it seems not responding. after clicking on it I am getting the
alert "unfortunately the app stopped working ". Please help me to solve the same .
Logcat :
01-13 05:55:17.117: E/AndroidRuntime(1067): FATAL EXCEPTION: main
01-13 05:55:17.117: E/AndroidRuntime(1067): Process: com.demo.xmppchat, PID: 1067
01-13 05:55:17.117: E/AndroidRuntime(1067): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.demo.xmppchat/com.demo.xmppchat.CustomizedListView}: java.lang.NullPointerException
01-13 05:55:17.117: E/AndroidRuntime(1067): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2176)
01-13 05:55:17.117: E/AndroidRuntime(1067): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2226)
01-13 05:55:17.117: E/AndroidRuntime(1067): at android.app.ActivityThread.access$700(ActivityThread.java:135)
01-13 05:55:17.117: E/AndroidRuntime(1067): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1397)
01-13 05:55:17.117: E/AndroidRuntime(1067): at android.os.Handler.dispatchMessage(Handler.java:102)
01-13 05:55:17.117: E/AndroidRuntime(1067): at android.os.Looper.loop(Looper.java:137)
01-13 05:55:17.117: E/AndroidRuntime(1067): at android.app.ActivityThread.main(ActivityThread.java:4998)
01-13 05:55:17.117: E/AndroidRuntime(1067): at java.lang.reflect.Method.invokeNative(Native Method)
01-13 05:55:17.117: E/AndroidRuntime(1067): at java.lang.reflect.Method.invoke(Method.java:515)
01-13 05:55:17.117: E/AndroidRuntime(1067): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:777)
01-13 05:55:17.117: E/AndroidRuntime(1067): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:593)
01-13 05:55:17.117: E/AndroidRuntime(1067): at dalvik.system.NativeStart.main(Native Method)
01-13 05:55:17.117: E/AndroidRuntime(1067): Caused by: java.lang.NullPointerException
01-13 05:55:17.117: E/AndroidRuntime(1067): at com.demo.xmppchat.CustomizedListView.onCreate(CustomizedListView.java:80)
01-13 05:55:17.117: E/AndroidRuntime(1067): at android.app.Activity.performCreate(Activity.java:5243)
01-13 05:55:17.117: E/AndroidRuntime(1067): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
01-13 05:55:17.117: E/AndroidRuntime(1067): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2140)
01-13 05:55:17.117: E/AndroidRuntime(1067): ... 11 more

Open properties of your project -> Java build path -> uncheck "Android Private Libraries" and "Android Dependencies".

Related

Infamous "Error inflating class com.google.android.gms.ads.AdView", works on Mac, not on PC

I have two different dev computers, a PC and a Mac Laptop. I frequently work on one, check into a private repo on BitBucket, and switch to another.
Recently I have been trying to add Ads to an Android application (my first) using adMob. I kept getting the "Error inflating class com.google.adroid.gms.ads.AdView" printed out in my LogCat when I try to run the app in the emulator.
I tried all the usual things found Googling:
Made sure that I imported a copy of the google-play-services-lib into my workspace.
Made sure my project referenced said library, and that the referenced library had a green tick next to it.
Made sure I had updated AndroidManifest.xml with required permissions, meta-data, and activity.
Made sure my activity .xml file is importing the the correct xmlns: xmlns:ads="http://schemas.android.com/apk/res-auto"
Finally I imported the GoogleAdsSampleActivity example into my workspace, added the google-play-services_lib as a library, and added my ad_unit_id, and it still wouldn't work.
On a whim, I checked everything in, and switched to my Mac. Everything works fine. Going back to my PC, I can get it to run in Android Studio, just not in eclipse, my Mac and PC are both using the same version of Eclipse (4.4.1 Build Id: 20140925-1800) and ADT (23.0.4.1468518). I have tried re-installing eclipse, re-installing ADT, using an older version of Eclipse, and even turning it off and on again, but I keep getting the same error.
Has anyone seen this before? Any other suggestions on what else I can try?
Thanks
Update
As requested, here is the full stack trace:
01-19 14:28:26.130: E/AndroidRuntime(1067): FATAL EXCEPTION: main
01-19 14:28:26.130: E/AndroidRuntime(1067): Process: com.google.android.gms.samples.ads, PID: 1067
01-19 14:28:26.130: E/AndroidRuntime(1067): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.google.android.gms.samples.ads/com.google.android.gms.samples.ads.BannerXmlActivity}: android.view.InflateException: Binary XML file line #24: Error inflating class com.google.android.gms.ads.AdView
01-19 14:28:26.130: E/AndroidRuntime(1067): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2195)
01-19 14:28:26.130: E/AndroidRuntime(1067): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
01-19 14:28:26.130: E/AndroidRuntime(1067): at android.app.ActivityThread.access$800(ActivityThread.java:135)
01-19 14:28:26.130: E/AndroidRuntime(1067): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
01-19 14:28:26.130: E/AndroidRuntime(1067): at android.os.Handler.dispatchMessage(Handler.java:102)
01-19 14:28:26.130: E/AndroidRuntime(1067): at android.os.Looper.loop(Looper.java:136)
01-19 14:28:26.130: E/AndroidRuntime(1067): at android.app.ActivityThread.main(ActivityThread.java:5017)
01-19 14:28:26.130: E/AndroidRuntime(1067): at java.lang.reflect.Method.invokeNative(Native Method)
01-19 14:28:26.130: E/AndroidRuntime(1067): at java.lang.reflect.Method.invoke(Method.java:515)
01-19 14:28:26.130: E/AndroidRuntime(1067): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
01-19 14:28:26.130: E/AndroidRuntime(1067): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
01-19 14:28:26.130: E/AndroidRuntime(1067): at dalvik.system.NativeStart.main(Native Method)
01-19 14:28:26.130: E/AndroidRuntime(1067): Caused by: android.view.InflateException: Binary XML file line #24: Error inflating class com.google.android.gms.ads.AdView
01-19 14:28:26.130: E/AndroidRuntime(1067): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:707)
01-19 14:28:26.130: E/AndroidRuntime(1067): at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
01-19 14:28:26.130: E/AndroidRuntime(1067): at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
01-19 14:28:26.130: E/AndroidRuntime(1067): at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
01-19 14:28:26.130: E/AndroidRuntime(1067): at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
01-19 14:28:26.130: E/AndroidRuntime(1067): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:290)
01-19 14:28:26.130: E/AndroidRuntime(1067): at android.app.Activity.setContentView(Activity.java:1929)
01-19 14:28:26.130: E/AndroidRuntime(1067): at com.google.android.gms.samples.ads.BannerXmlActivity.onCreate(BannerXmlActivity.java:34)
01-19 14:28:26.130: E/AndroidRuntime(1067): at android.app.Activity.performCreate(Activity.java:5231)
01-19 14:28:26.130: E/AndroidRuntime(1067): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
01-19 14:28:26.130: E/AndroidRuntime(1067): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
01-19 14:28:26.130: E/AndroidRuntime(1067): ... 11 more
01-19 14:28:26.130: E/AndroidRuntime(1067): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.ads.AdView" on path: DexPathList[[zip file "/data/app/com.google.android.gms.samples.ads-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.google.android.gms.samples.ads-1, /system/lib]]
01-19 14:28:26.130: E/AndroidRuntime(1067): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
01-19 14:28:26.130: E/AndroidRuntime(1067): at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
01-19 14:28:26.130: E/AndroidRuntime(1067): at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
01-19 14:28:26.130: E/AndroidRuntime(1067): at android.view.LayoutInflater.createView(LayoutInflater.java:559)
01-19 14:28:26.130: E/AndroidRuntime(1067): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:696)
01-19 14:28:26.130: E/AndroidRuntime(1067): ... 21 more
Additionally, I realized that my emulator was running Android API level 17, so I thought this was the problem. Strangely enough, even though all the system images were installed, it would not let me create an emulator that would run level 19. Upon further investigation, I found that Eclipse was pointing to a version of the SDK that I installed manually, presumably a couple (or few) years ago. I changed it to use the same SDK that Android Studio is using and can now create a level 19 emulator, but am still getting this same error.
Concerning the code, I have made no changes to the GoogleAdsSampleActivity sample other than adding my own ad_unit_id. That is the sample I ran to get the above error.
Instead of putting xmlns:android="http://schemas.android.com/apk/res/android" in the Linear Layout tag, put it in <com.google.android.gms.ads.AdView tag. as shown below:
<com.google.android.gms.ads.AdView
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:id="#+id/adView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
app:adSize="SMART_BANNER"
/>
For further assistance visit this Link

paypal payment with cordova plugin

I'm trying to use paypal payment in my cordova application.
For that I used this Paypal cordova plugin. I followed all the instructions mentioned there, but I get these errors:
01-13 05:18:06.650: E/PluginManager(2112): Uncaught exception from plugin
01-13 05:18:06.650: E/PluginManager(2112): android.content.ActivityNotFoundException: Unable to find explicit activity class {com.example.hello/com.paypal.android.sdk.payments.PaymentActivity}; have you declared this activity in your AndroidManifest.xml?
01-13 05:18:06.650: E/PluginManager(2112): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1628)
01-13 05:18:06.650: E/PluginManager(2112): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1424)
01-13 05:18:06.650: E/PluginManager(2112): at android.app.Activity.startActivityForResult(Activity.java:3424)
01-13 05:18:06.650: E/PluginManager(2112): at android.app.Activity.startActivityForResult(Activity.java:3385)
01-13 05:18:06.650: E/PluginManager(2112): at org.apache.cordova.CordovaActivity.startActivityForResult(CordovaActivity.java:748)
01-13 05:18:06.650: E/PluginManager(2112): at com.paypal.cordova.sdk.PayPalMobileCordovaPlugin.renderSinglePaymentUI(PayPalMobileCordovaPlugin.java:226)
01-13 05:18:06.650: E/PluginManager(2112): at com.paypal.cordova.sdk.PayPalMobileCordovaPlugin.execute(PayPalMobileCordovaPlugin.java:54)
01-13 05:18:06.650: E/PluginManager(2112): at org.apache.cordova.CordovaPlugin.execute(CordovaPlugin.java:84)
01-13 05:18:06.650: E/PluginManager(2112): at org.apache.cordova.PluginManager.exec(PluginManager.java:147)
01-13 05:18:06.650: E/PluginManager(2112): at org.apache.cordova.CordovaBridge.jsExec(CordovaBridge.java:59)
01-13 05:18:06.650: E/PluginManager(2112): at org.apache.cordova.ExposedJsApi.exec(ExposedJsApi.java:40)
01-13 05:18:06.650: E/PluginManager(2112): at com.android.org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native Method)
01-13 05:18:06.650: E/PluginManager(2112): at com.android.org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:27)
01-13 05:18:06.650: E/PluginManager(2112): at android.os.Handler.dispatchMessage(Handler.java:102)
01-13 05:18:06.650: E/PluginManager(2112): at android.os.Looper.loop(Looper.java:136)
01-13 05:18:06.650: E/PluginManager(2112): at android.os.HandlerThread.run(HandlerThread.java:61)
Can any one help me to figure out this problem?
I resolved the problem.
In the process of installation of the plugin there was a problem.
So that I referenced the file cdv-plugin-paypal-mobile-sdk.js in the paymnt.html page and it works now.

Store/Save & Retrieve to/from SharedPreference Failure

I've been having so much problem with this Live Wallpaper.
I have read alot online about these, and I thought I understood and got them.
When I tried to apply them to this live wallpaper, everything has been going very rough.
I've spent all day and night :-(
Could you someone please help me out?
My goal is to store the new password from edittextpreference to the
Sharedpreference, and then retrieve this password to compared with the login
password to if they are matched.
For example,
I have 2 edittextpreferences:
1) is for create new password which will be saved to the SharedPreference
2) is for login password.
The users will be granted the access when the login password is matched with the
one in the SharedPreference.
Please help me out,
I would be appreciated for your help.
prefs.java Code:
#SuppressWarnings("deprecation")
#Override
protected void onDestroy() {
getPreferenceManager().getSharedPreferences()
.unregisterOnSharedPreferenceChangeListener(this);
super.onDestroy();
}
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences,
String key) {
// TODO Auto-generated method stub
{
}
}
{
SharedPreferences mlogin_password = this.getSharedPreferences("data_storage", MODE_PRIVATE);
Editor login_password = mlogin_password.edit();
login_password.putString("login", "login_pw2");
login_password.commit();
SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(Context);
String s = sp.getString("login", null);
Sorry for 10000000 of error codes :-(
Logcat:
at android.util.Log.println_native(Native Method)
at android.util.Log.v(Log.java:117)
at rare_war.weapons.prefs.<init>(prefs.java:60)
at java.lang.Class.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(Class.java:1130)
at android.app.Instrumentation.newActivity(Instrumentation.java:1061)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2128)
... 11 more
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2137)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)
at android.app.ActivityThread.access$600(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5103)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
at rare_war.weapons.prefs.<init>(prefs.java:65)
at java.lang.Class.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(Class.java:1130)
at android.app.Instrumentation.newActivity(Instrumentation.java:1061)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2128)
... 11 more
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2137)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)
at android.app.ActivityThread.access$600(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5103)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
at rare_war.weapons.prefs.<init>(prefs.java:65)
at java.lang.Class.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(Class.java:1130)
at android.app.Instrumentation.newActivity(Instrumentation.java:1061)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2128)
... 11 more
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2137)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)
at android.app.ActivityThread.access$600(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5103)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
at android.content.ContextWrapper.getSharedPreferences(ContextWrapper.java:167)
at rare_war.weapons.prefs.<init>(prefs.java:62)
at java.lang.Class.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(Class.java:1130)
at android.app.Instrumentation.newActivity(Instrumentation.java:1061)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2128)
... 11 more
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2137)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)
at android.app.ActivityThread.access$600(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5103)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
at android.content.ContextWrapper.getSharedPreferences(ContextWrapper.java:167)
at rare_war.weapons.prefs.<init>(prefs.java:62)
at java.lang.Class.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(Class.java:1130)
at android.app.Instrumentation.newActivity(Instrumentation.java:1061)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2128)
... 11 more
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2137)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)
at android.app.ActivityThread.access$600(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5103)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
at android.content.ContextWrapper.getSharedPreferences(ContextWrapper.java:167)
at rare_war.weapons.prefs.<init>(prefs.java:62)
at java.lang.Class.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(Class.java:1130)
at android.app.Instrumentation.newActivity(Instrumentation.java:1061)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2128)
... 11 more
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2137)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)
at android.app.ActivityThread.access$600(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5103)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
at android.content.ContextWrapper.getSharedPreferences(ContextWrapper.java:167)
at rare_war.weapons.prefs.<init>(prefs.java:62)
at java.lang.Class.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(Class.java:1130)
at android.app.Instrumentation.newActivity(Instrumentation.java:1061)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2128)
... 11 more
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2137)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)
at android.app.ActivityThread.access$600(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5103)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
at android.content.ContextWrapper.getSharedPreferences(ContextWrapper.java:167)
at rare_war.weapons.prefs.<init>(prefs.java:62)
at java.lang.Class.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(Class.java:1130)
at android.app.Instrumentation.newActivity(Instrumentation.java:1061)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2128)
... 11 more
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2137)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)
at android.app.ActivityThread.access$600(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5103)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
at android.content.ContextWrapper.getSharedPreferences(ContextWrapper.java:167)
at rare_war.weapons.prefs.<init>(prefs.java:64)
at java.lang.Class.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(Class.java:1130)
at android.app.Instrumentation.newActivity(Instrumentation.java:1061)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2128)
... 11 more
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2137)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)
at android.app.ActivityThread.access$600(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5103)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
at android.content.ContextWrapper.getPackageName(ContextWrapper.java:135)
at android.preference.PreferenceManager.getDefaultSharedPreferencesName(PreferenceManager.java:374)
at android.preference.PreferenceManager.getDefaultSharedPreferences(PreferenceManager.java:369)
at rare_war.weapons.prefs.<init>(prefs.java:66)
at java.lang.Class.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(Class.java:1130)
at android.app.Instrumentation.newActivity(Instrumentation.java:1061)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2128)
... 11 more
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2137)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)
at android.app.ActivityThread.access$600(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5103)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
at android.content.ContextWrapper.getSharedPreferences(ContextWrapper.java:167)
at rare_war.weapons.prefs.<init>(prefs.java:63)
at java.lang.Class.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(Class.java:1130)
at android.app.Instrumentation.newActivity(Instrumentation.java:1061)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2128)
... 11 more
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2137)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)
at android.app.ActivityThread.access$600(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5103)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
at android.content.ContextWrapper.getPackageName(ContextWrapper.java:135)
at android.preference.PreferenceManager.getDefaultSharedPreferencesName(PreferenceManager.java:374)
at android.preference.PreferenceManager.getDefaultSharedPreferences(PreferenceManager.java:369)
at rare_war.weapons.prefs.<init>(prefs.java:65)
at java.lang.Class.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(Class.java:1130)
at android.app.Instrumentation.newActivity(Instrumentation.java:1061)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2128)
... 11 more
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2137)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)
at android.app.ActivityThread.access$600(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5103)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
at android.preference.PreferenceManager.getDefaultSharedPreferencesName(PreferenceManager.java:374)
at android.preference.PreferenceManager.getDefaultSharedPreferences(PreferenceManager.java:369)
at rare_war.weapons.prefs.<init>(prefs.java:68)
at java.lang.Class.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(Class.java:1130)
at android.app.Instrumentation.newActivity(Instrumentation.java:1061)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2128)
... 11 more
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2137)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)
at android.app.ActivityThread.access$600(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5103)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
at android.preference.PreferenceManager.getDefaultSharedPreferencesName(PreferenceManager.java:374)
at android.preference.PreferenceManager.getDefaultSharedPreferences(PreferenceManager.java:369)
at rare_war.weapons.prefs.<init>(prefs.java:68)
at java.lang.Class.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(Class.java:1130)
at android.app.Instrumentation.newActivity(Instrumentation.java:1061)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2128)
... 11 more
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2137)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)
at android.app.ActivityThread.access$600(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5103)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
at android.preference.PreferenceManager.getDefaultSharedPreferencesName(PreferenceManager.java:374)
at android.preference.PreferenceManager.getDefaultSharedPreferences(PreferenceManager.java:369)
at rare_war.weapons.prefs.<init>(prefs.java:68)
at java.lang.Class.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(Class.java:1130)
at android.app.Instrumentation.newActivity(Instrumentation.java:1061)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2128)
... 11 more
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2137)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)
at android.app.ActivityThread.access$600(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5103)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
at android.preference.PreferenceManager.getDefaultSharedPreferencesName(PreferenceManager.java:374)
at android.preference.PreferenceManager.getDefaultSharedPreferences(PreferenceManager.java:369)
at rare_war.weapons.prefs.<init>(prefs.java:75)
at java.lang.Class.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(Class.java:1130)
at android.app.Instrumentation.newActivity(Instrumentation.java:1061)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2128)
... 11 more
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2137)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)
at android.app.ActivityThread.access$600(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5103)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
at android.preference.PreferenceManager.getDefaultSharedPreferencesName(PreferenceManager.java:374)
at android.preference.PreferenceManager.getDefaultSharedPreferences(PreferenceManager.java:369)
at rare_war.weapons.prefs.<init>(prefs.java:74)
at java.lang.Class.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(Class.java:1130)
at android.app.Instrumentation.newActivity(Instrumentation.java:1061)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2128)
... 11 more
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2137)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)
at android.app.ActivityThread.access$600(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5103)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
at android.content.ContextWrapper.getSharedPreferences(ContextWrapper.java:167)
at rare_war.weapons.prefs.<init>(prefs.java:68)
at java.lang.Class.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(Class.java:1130)
at android.app.Instrumentation.newActivity(Instrumentation.java:1061)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2128)
... 11 more
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2137)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)
at android.app.ActivityThread.access$600(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5103)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
at android.content.ContextWrapper.getSharedPreferences(ContextWrapper.java:167)
at rare_war.weapons.prefs.<init>(prefs.java:68)
at java.lang.Class.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(Class.java:1130)
at android.app.Instrumentation.newActivity(Instrumentation.java:1061)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2128)
... 11 more
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2137)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)
at android.app.ActivityThread.access$600(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5103)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
at android.content.ContextWrapper.getSharedPreferences(ContextWrapper.java:167)
at rare_war.weapons.prefs.<init>(prefs.java:68)
at java.lang.Class.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(Class.java:1130)
at android.app.Instrumentation.newActivity(Instrumentation.java:1061)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2128)
... 11 more
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2137)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)
at android.app.ActivityThread.access$600(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5103)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
at android.preference.PreferenceManager.getDefaultSharedPreferencesName(PreferenceManager.java:374)
at android.preference.PreferenceManager.getDefaultSharedPreferences(PreferenceManager.java:369)
at rare_war.weapons.prefs.<init>(prefs.java:75)
at java.lang.Class.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(Class.java:1130)
at android.app.Instrumentation.newActivity(Instrumentation.java:1061)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2128)
... 11 more
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2137)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)
at android.app.ActivityThread.access$600(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5103)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
at android.content.ContextWrapper.getSharedPreferences(ContextWrapper.java:167)
at rare_war.weapons.prefs.<init>(prefs.java:68)
at java.lang.Class.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(Class.java:1130)
at android.app.Instrumentation.newActivity(Instrumentation.java:1061)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2128)
... 11 more
My goal is to store the new password from edittextpreference to the
Sharedpreference...
Not a good idea. You shouldn't store passwords on SharedPreferences
I would suggest using a different approach like storing the encrypted password on a server and then check what the user entered against it.
Please, also make sure you read the Android guide on SharedPreferences
Hi you are saving password on sharedPreference named 'data_storage' and retrieving from default sharedPreference thats why you are not getting saved password.Try to save and retrieve preference value from same sharedPreference.
Why don't you use getSharedPreferences for the key "data_storage" and not for getDefaultSharedPreferences, in other words, Context? I'm not really sure about it, but you should try.
The mechanism works as follows: you save the key under a string name "date_storage" then you retrieve they key. In both cases you need to get the SharedPreferences with the line:
SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(Context);
After that use the "sp.get()" methods to get the required value for the saved string key ("data_storage").

Set brightness of flash in Android

In my program I tested this:
try {
FileWriter mWriter = new FileWriter("/sys/class/leds/flashlight/brightness");
mWriter.write(125);
mWriter.flush();
} catch (Exception e) {
Log.e(TAG, "setFlashlightEnabled failed", e);
}
I have this in the log :
01-13 14:56:30.578: E/test(603): setFlashlightEnabled failed
01-13 14:56:30.578: E/test(603): java.io.FileNotFoundException: /sys/class/leds/flashlight/brightness (Permission denied)
01-13 14:56:30.578: E/test(603): at org.apache.harmony.luni.platform.OSFileSystem.open(Native Method)
01-13 14:56:30.578: E/test(603): at dalvik.system.BlockGuard$WrappedFileSystem.open(BlockGuard.java:232)
01-13 14:56:30.578: E/test(603): at java.io.FileOutputStream.<init>(FileOutputStream.java:94)
01-13 14:56:30.578: E/test(603): at java.io.FileOutputStream.<init>(FileOutputStream.java:66)
01-13 14:56:30.578: E/test(603): at java.io.FileWriter.<init>(FileWriter.java:80)
01-13 14:56:30.578: E/test(603): at sad.sdsa.sdjahskdhj.TestpuissanceActivity.onClick(TestpuissanceActivity.java:87)
01-13 14:56:30.578: E/test(603): at android.view.View.performClick(View.java)
01-13 14:56:30.578: E/test(603): at android.view.View$PerformClick.run(View.java)
01-13 14:56:30.578: E/test(603): at android.os.Handler.handleCallback(Handler.java)
01-13 14:56:30.578: E/test(603): at android.os.Handler.dispatchMessage(Handler.java)
01-13 14:56:30.578: E/test(603): at android.os.Looper.loop(Looper.java)
01-13 14:56:30.578: E/test(603): at android.app.ActivityThread.main(ActivityThread.java)
01-13 14:56:30.578: E/test(603): at java.lang.reflect.Method.invokeNative(Native Method)
01-13 14:56:30.578: E/test(603): at java.lang.reflect.Method.invoke(Method.java:507)
01-13 14:56:30.578: E/test(603): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java)
01-13 14:56:30.578: E/test(603): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java)
01-13 14:56:30.578: E/test(603): at dalvik.system.NativeStart.main(Native Method)
I have tested in ADB Shell this :
echo 125 > /sys/class/leds/flashlight/brightness
It works in root but not in normal mode.
What is the solution to change the flash output without being root?
It belongs to system and is being protected by system, so you must be a root to access.Also all Android devices dont have the same flashlight design in structure, sample like: in HTC device, it supports API for handling 3 different brightness level, but others don't...

Error :Unable to open trace file '/mnt/sdcard/method.trace': Permission denied in android 3.0

I am facing problem while creating trace file using
Debug.startMethodTracing("traceFile");
I have also added
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
in manifest file
But when I am trying to run the application I am getting this error
01-13 10:53:32.739: D/dalvikvm(1261): +++ active profiler count now 1
01-13 10:53:32.739: I/dalvikvm(1261): TRACE STARTED: '/mnt/sdcard/traceFile.trace' 8192KB
01-13 10:53:32.739: E/dalvikvm(1261): Unable to open trace file '/mnt/sdcard/traceFile.trace': Permission denied
01-13 10:53:32.739: D/dalvikvm(1261): +++ active profiler count now 0
01-13 10:53:32.950: D/AndroidRuntime(1261): Shutting down VM
01-13 10:53:32.950: W/dalvikvm(1261): threadid=1: thread exiting with uncaught exception (group=0x40014760)
01-13 10:53:33.070: E/AndroidRuntime(1261): FATAL EXCEPTION: main
01-13 10:53:33.070: E/AndroidRuntime(1261): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.sample.internetTV/com.sample.internetTV.Internet_TV4}: java.lang.RuntimeException: Unable to open trace file '/mnt/sdcard/traceFile.trace': Permission denied
01-13 10:53:33.070: E/AndroidRuntime(1261): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1736)
01-13 10:53:33.070: E/AndroidRuntime(1261): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1752)
01-13 10:53:33.070: E/AndroidRuntime(1261): at android.app.ActivityThread.access$1500(ActivityThread.java:123)
01-13 10:53:33.070: E/AndroidRuntime(1261): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:993)
01-13 10:53:33.070: E/AndroidRuntime(1261): at android.os.Handler.dispatchMessage(Handler.java:99)
01-13 10:53:33.070: E/AndroidRuntime(1261): at android.os.Looper.loop(Looper.java:126)
01-13 10:53:33.070: E/AndroidRuntime(1261): at android.app.ActivityThread.main(ActivityThread.java:3997)
01-13 10:53:33.070: E/AndroidRuntime(1261): at java.lang.reflect.Method.invokeNative(Native Method)
01-13 10:53:33.070: E/AndroidRuntime(1261): at java.lang.reflect.Method.invoke(Method.java:491)
01-13 10:53:33.070: E/AndroidRuntime(1261): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
01-13 10:53:33.070: E/AndroidRuntime(1261): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
01-13 10:53:33.070: E/AndroidRuntime(1261): at dalvik.system.NativeStart.main(Native Method)
01-13 10:53:33.070: E/AndroidRuntime(1261): Caused by: java.lang.RuntimeException: Unable to open trace file '/mnt/sdcard/traceFile.trace': Permission denied
01-13 10:53:33.070: E/AndroidRuntime(1261): at dalvik.system.VMDebug.startMethodTracingNative(Native Method)
01-13 10:53:33.070: E/AndroidRuntime(1261): at dalvik.system.VMDebug.startMethodTracing(VMDebug.java:175)
01-13 10:53:33.070: E/AndroidRuntime(1261): at android.os.Debug.startMethodTracing(Debug.java:458)
01-13 10:53:33.070: E/AndroidRuntime(1261): at android.os.Debug.startMethodTracing(Debug.java:406)
01-13 10:53:33.070: E/AndroidRuntime(1261): at com.sample.internetTV.Internet_TV4.onCreate(Internet_TV4.java:37)
01-13 10:53:33.070: E/AndroidRuntime(1261): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1048)
01-13 10:53:33.070: E/AndroidRuntime(1261): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1700)
01-13 10:53:33.070: E/AndroidRuntime(1261): ... 11 more
This was working fine in Android 2.2 version. But In Android 3.0 I am getting error
So can anybody please help me to solve this problem.
Thanks in Advance

Categories

Resources