Update list with RSS data - android

I am working on displaying some RSS data in a ListView. I was reading up on the onProgressUpdate() method provided by the Asynchronous task class.
I was wondering if it would be possible to use this method to update the listview as each item from XML is retrieved?
I overrided the method here:
#Override
protected void onProgressUpdate(Integer... values) {
adapter.notifyDataSetChanged();
}
I am getting this error:
Caused by: android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.
Any ideas where I am going wrong?
EDIT: I just read an article saying this error is generated from trying to update the UI thread from within the background thread inside of the doInBackground() method. In my case I am calling the onProgressUpdate() in the doInBackground() method. I was trying to add the effect of the list populating as each item was downloaded.
Any suggestions of how I could achieve this would be great!
Log cat:
01-13 00:41:09.195: E/AndroidRuntime(32239): FATAL EXCEPTION: AsyncTask #1
01-13 00:41:09.195: E/AndroidRuntime(32239): java.lang.RuntimeException: An error occured while executing doInBackground()
01-13 00:41:09.195: E/AndroidRuntime(32239): at android.os.AsyncTask$3.done(AsyncTask.java:299)
01-13 00:41:09.195: E/AndroidRuntime(32239): at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:352)
01-13 00:41:09.195: E/AndroidRuntime(32239): at java.util.concurrent.FutureTask.setException(FutureTask.java:219)
01-13 00:41:09.195: E/AndroidRuntime(32239): at java.util.concurrent.FutureTask.run(FutureTask.java:239)
01-13 00:41:09.195: E/AndroidRuntime(32239): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
01-13 00:41:09.195: E/AndroidRuntime(32239): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
01-13 00:41:09.195: E/AndroidRuntime(32239): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
01-13 00:41:09.195: E/AndroidRuntime(32239): at java.lang.Thread.run(Thread.java:856)
01-13 00:41:09.195: E/AndroidRuntime(32239): Caused by: android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.
01-13 00:41:09.195: E/AndroidRuntime(32239): at android.view.ViewRootImpl.checkThread(ViewRootImpl.java:4746)
01-13 00:41:09.195: E/AndroidRuntime(32239): at android.view.ViewRootImpl.requestLayout(ViewRootImpl.java:823)
01-13 00:41:09.195: E/AndroidRuntime(32239): at android.view.View.requestLayout(View.java:15468)
01-13 00:41:09.195: E/AndroidRuntime(32239): at android.view.View.requestLayout(View.java:15468)
01-13 00:41:09.195: E/AndroidRuntime(32239): at android.view.View.requestLayout(View.java:15468)
01-13 00:41:09.195: E/AndroidRuntime(32239): at android.view.View.requestLayout(View.java:15468)
01-13 00:41:09.195: E/AndroidRuntime(32239): at android.widget.RelativeLayout.requestLayout(RelativeLayout.java:318)
01-13 00:41:09.195: E/AndroidRuntime(32239): at android.view.View.requestLayout(View.java:15468)
01-13 00:41:09.195: E/AndroidRuntime(32239): at android.widget.AbsListView.requestLayout(AbsListView.java:1819)
01-13 00:41:09.195: E/AndroidRuntime(32239): at android.widget.AdapterView$AdapterDataSetObserver.onChanged(AdapterView.java:813)
01-13 00:41:09.195: E/AndroidRuntime(32239): at android.widget.AbsListView$AdapterDataSetObserver.onChanged(AbsListView.java:5958)
01-13 00:41:09.195: E/AndroidRuntime(32239): at android.database.DataSetObservable.notifyChanged(DataSetObservable.java:37)
01-13 00:41:09.195: E/AndroidRuntime(32239): at android.widget.BaseAdapter.notifyDataSetChanged(BaseAdapter.java:50)
01-13 00:41:09.195: E/AndroidRuntime(32239): at android.widget.ArrayAdapter.notifyDataSetChanged(ArrayAdapter.java:286)
01-13 00:41:09.195: E/AndroidRuntime(32239): at com.example.simplerss.MainActivity$PostTask.onProgressUpdate(MainActivity.java:148)
01-13 00:41:09.195: E/AndroidRuntime(32239): at com.example.simplerss.MainActivity$PostTask.doInBackground(MainActivity.java:123)
01-13 00:41:09.195: E/AndroidRuntime(32239): at com.example.simplerss.MainActivity$PostTask.doInBackground(MainActivity.java:1)
01-13 00:41:09.195: E/AndroidRuntime(32239): at android.os.AsyncTask$2.call(AsyncTask.java:287)
01-13 00:41:09.195: E/AndroidRuntime(32239): at java.util.concurrent.FutureTask.run(FutureTask.java:234)
01-13 00:41:09.195: E/AndroidRuntime(32239): ... 4 more

In my case I am calling the onProgressUpdate() in the doInBackground()
method.
You have to call publishProgress() instead. If you directly call onProgressUpdate(), that is still running from the background thread and so, will fail.
You should take a look at the AsyncTask documentation, they provide an example.

Related

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.

Phonegap 3.2.0 "Unfortunately, AppName has stopped." dialog when closing app

When I close my app, I get a dialog box saying "Unfortunately, MyApp has stopped." and an OK button. By closing, I mean pressing the back button from the first screen. The app does close fine, but then this dialog appears a few seconds later.
I'm using PhoneGap 3.2.0. It didn't happen prior to updating to 3.x.x. I'm not sure exactly which version after this is the culprit.
The LogCat in Eclipse puts out this when it happens:
01-13 15:20:42.764: D/CordovaActivity(32367): onMessage(exit,null)
01-13 15:20:42.829: D/CordovaActivity(32367): Paused the application!
01-13 15:20:42.839: W/PluginManager(32367): THREAD WARNING: exec() call to App.exitApp blocked the main thread for 74ms. Plugin should use CordovaInterface.getThreadPool().
01-13 15:20:43.219: W/IInputConnectionWrapper(32367): showStatusIcon on inactive InputConnection
01-13 15:20:43.254: D/CordovaActivity(32367): CordovaActivity.onDestroy()
01-13 15:20:43.259: D/CordovaWebView(32367): >>> loadUrlNow()
01-13 15:20:43.284: D/AndroidRuntime(32367): Shutting down VM
01-13 15:20:43.284: W/dalvikvm(32367): threadid=1: thread exiting with uncaught exception (group=0x417752a0)
01-13 09:56:40.404: E/AndroidRuntime(13858): java.lang.RuntimeException: Unable to destroy activity {MyAppName}: java.lang.IllegalArgumentException: Receiver not registered: null
01-13 09:56:40.404: E/AndroidRuntime(13858): at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3314)
01-13 09:56:40.404: E/AndroidRuntime(13858): at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:3332)
01-13 09:56:40.404: E/AndroidRuntime(13858): at android.app.ActivityThread.access$1200(ActivityThread.java:140)
01-13 09:56:40.404: E/AndroidRuntime(13858): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1280)
01-13 09:56:40.404: E/AndroidRuntime(13858): at android.os.Handler.dispatchMessage(Handler.java:99)
01-13 09:56:40.404: E/AndroidRuntime(13858): at android.os.Looper.loop(Looper.java:137)
01-13 09:56:40.404: E/AndroidRuntime(13858): at android.app.ActivityThread.main(ActivityThread.java:4898)
01-13 09:56:40.404: E/AndroidRuntime(13858): at java.lang.reflect.Method.invokeNative(Native Method)
01-13 09:56:40.404: E/AndroidRuntime(13858): at java.lang.reflect.Method.invoke(Method.java:511)
01-13 09:56:40.404: E/AndroidRuntime(13858): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1006)
01-13 09:56:40.404: E/AndroidRuntime(13858): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:773)
01-13 09:56:40.404: E/AndroidRuntime(13858): at dalvik.system.NativeStart.main(Native Method)
01-13 09:56:40.404: E/AndroidRuntime(13858): Caused by: java.lang.IllegalArgumentException: Receiver not registered: null
01-13 09:56:40.404: E/AndroidRuntime(13858): at android.app.LoadedApk.forgetReceiverDispatcher(LoadedApk.java:654)
01-13 09:56:40.404: E/AndroidRuntime(13858): at android.app.ContextImpl.unregisterReceiver(ContextImpl.java:1277)
01-13 09:56:40.404: E/AndroidRuntime(13858): at android.content.ContextWrapper.unregisterReceiver(ContextWrapper.java:385)
01-13 09:56:40.404: E/AndroidRuntime(13858): at org.apache.cordova.device.Device.onDestroy(Device.java:98)
01-13 09:56:40.404: E/AndroidRuntime(13858): at org.apache.cordova.PluginManager.onDestroy(PluginManager.java:332)
01-13 09:56:40.404: E/AndroidRuntime(13858): at org.apache.cordova.CordovaWebView.handleDestroy(CordovaWebView.java:833)
01-13 09:56:40.404: E/AndroidRuntime(13858): at org.apache.cordova.CordovaActivity.onDestroy(CordovaActivity.java:774)
01-13 09:56:40.404: E/AndroidRuntime(13858): at android.app.Activity.performDestroy(Activity.java:5370)
01-13 09:56:40.404: E/AndroidRuntime(13858): at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1113)
01-13 09:56:40.404: E/AndroidRuntime(13858): at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3301)
01-13 09:56:40.404: E/AndroidRuntime(13858): ... 11 more
Any ideas?
Until now, I've always been using the line
navigator.app.exitApp();
to close the app if I detect that I'm on the index.html page when the back button is pressed.
I tried instead to remove the backbutton listener and restore the default behaviour when the back button was pressed. It still results in the same problem.
Here's some shortened code snippets:
$(document).ready(function ()
{
document.addEventListener("deviceready", onDeviceReady, false);
}
function onDeviceReady()
{
document.addEventListener("backbutton", backButton, false);
});
function backButton()
{
var currentLocation = window.location.href.substr(window.location.href.lastIndexOf("/")+1);
switch (currentLocation) {
case 'index.html':
navigator.app.exitApp();
break;
}
Update 2014/01/13 16:00:
Not sure if it is any help, but I've noticed that it doesn't give any errors if I comment out the script src="cordova.js" from index.html.
In the file Device.java replace the content of OnDestroy with this
if( this.telephonyReceiver != null )
this.cordova.getActivity().unregisterReceiver(this.telephonyReceiver);
Warning: This is hiding the original problem where the BroadcastReceiver isn't being registered properly from what I got from the logcat. Adding the permission to the AndroidManifest.xml like suprnova said should've worked.
But if you don't need to know the phone state, ie, if you're getting a call, or something like that, and you need a quick fix.
Warning 2: When the next phonegap version comes out, this may get overridden.
Judging by your LogCat, the problem lies in the Device.java file, and looking at the source here, the class registers a BroadcastReceiver to check the phone state.
Make sure you have added:
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
to your AndroidManifest.xml.

i am trying to send request to https://www.google.com and get a responce. I am using asyncTask but getting the following exception [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
12-17 11:01:44.227: E/AndroidRuntime(1768): FATAL EXCEPTION: AsyncTask #1
12-17 11:01:44.227: E/AndroidRuntime(1768): java.lang.RuntimeException: An error occured while executing doInBackground()
12-17 11:01:44.227: E/AndroidRuntime(1768): at android.os.AsyncTask$3.done(AsyncTask.java:299)
12-17 11:01:44.227: E/AndroidRuntime(1768): at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:273)
12-17 11:01:44.227: E/AndroidRuntime(1768): at java.util.concurrent.FutureTask.setException(FutureTask.java:124)
12-17 11:01:44.227: E/AndroidRuntime(1768): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:307)
12-17 11:01:44.227: E/AndroidRuntime(1768): at java.util.concurrent.FutureTask.run(FutureTask.java:137)
12-17 11:01:44.227: E/AndroidRuntime(1768): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
12-17 11:01:44.227: E/AndroidRuntime(1768): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
12-17 11:01:44.227: E/AndroidRuntime(1768): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
12-17 11:01:44.227: E/AndroidRuntime(1768): at java.lang.Thread.run(Thread.java:856)
12-17 11:01:44.227: E/AndroidRuntime(1768): Caused by: android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.
12-17 11:01:44.227: E/AndroidRuntime(1768): at android.view.ViewRootImpl.checkThread(ViewRootImpl.java:4607)
12-17 11:01:44.227: E/AndroidRuntime(1768): at android.view.ViewRootImpl.requestLayout(ViewRootImpl.java:835)
12-17 11:01:44.227: E/AndroidRuntime(1768): at android.view.View.requestLayout(View.java:15129)
12-17 11:01:44.227: E/AndroidRuntime(1768): at android.view.View.requestLayout(View.java:15129)
12-17 11:01:44.227: E/AndroidRuntime(1768): at android.view.View.requestLayout(View.java:15129)
12-17 11:01:44.227: E/AndroidRuntime(1768): at android.view.View.requestLayout(View.java:15129)
12-17 11:01:44.227: E/AndroidRuntime(1768): at android.widget.RelativeLayout.requestLayout(RelativeLayout.java:292)
12-17 11:01:44.227: E/AndroidRuntime(1768): at android.view.View.requestLayout(View.java:15129)
12-17 11:01:44.227: E/AndroidRuntime(1768): at android.widget.TextView.checkForRelayout(TextView.java:6303)
12-17 11:01:44.227: E/AndroidRuntime(1768): at android.widget.TextView.setText(TextView.java:3547)
12-17 11:01:44.227: E/AndroidRuntime(1768): at android.widget.TextView.setText(TextView.java:3405)
12-17 11:01:44.227: E/AndroidRuntime(1768): at android.widget.TextView.setText(TextView.java:3380)
12-17 11:01:44.227: E/AndroidRuntime(1768): at com.example.internet.MainActivity$RequestTask.doInBackground(MainActivity.java:150)
12-17 11:01:44.227: E/AndroidRuntime(1768): at com.example.internet.MainActivity$RequestTask.doInBackground(MainActivity.java:1)
12-17 11:01:44.227: E/AndroidRuntime(1768): at android.os.AsyncTask$2.call(AsyncTask.java:287)
12-17 11:01:44.227: E/AndroidRuntime(1768): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
12-17 11:01:44.227: E/AndroidRuntime(1768): ... 5 more
12-17 11:01:44.857: W/IInputConnectionWrapper(1768): showStatusIcon on inactive InputConnection
this is the cause.
Caused by: android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.
UI cant be updated from doInBackground
You should provide the code as well , specifically for the relevant part.
Here is an example of an approach that can be used
private class SaveProfile extends AsyncTask<String, Void, Boolean>{
#Override
protected Boolean doInBackground(String... params) {
//---------- so your stuff here.... non ui related
Log.v("response from saving",response);
if(response.equals("1")){
return true;
}else{
return false;
}
}
protected void onPostExecute(Boolean result) {
if(result) {
//------ UPDATE UI HERE
Toast.makeText(ProfileCompanyActivity.this, "profile saved", 2500).show();
}else{
Toast.makeText(ProfileCompanyActivity.this, "an error occured", 2500).show();
}
}
}
First you must Understand the Concept of AsynTask in android...
1) you cannot update or change your UI element in backGround thread i.e doInBackGround()
2) use onPreExcecute() or onPostExcecute() to change or update your UI element
And to be Sure you are accessing UI element into doInBackGround
Check out this Example to Understant how the Methods work
Hope this could help....

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