error with having 2 spinner - android

I have this type of error can you help me how can i solve it
or what is the problem
knowing that this code i use it with other spinner with other class and it is work
so it kind of confusing me
dose the problem having because i have to spinner or it not?
her is my logcat
11-16 21:56:27.841: E/AndroidRuntime(794): FATAL EXCEPTION: main
11-16 21:56:27.841: E/AndroidRuntime(794): java.lang.NullPointerException
11-16 21:56:27.841: E/AndroidRuntime(794): at android.widget.ArrayAdapter.getCount(ArrayAdapter.java:291)
11-16 21:56:27.841: E/AndroidRuntime(794): at android.widget.AbsSpinner.setAdapter(AbsSpinner.java:113)
11-16 21:56:27.841: E/AndroidRuntime(794): at com.example.test1.MainActivity$LoadAllSection.onPostExecute(MainActivity.java:220)
11-16 21:56:27.841: E/AndroidRuntime(794): at com.example.test1.MainActivity$LoadAllSection.onPostExecute(MainActivity.java:1)
11-16 21:56:27.841: E/AndroidRuntime(794): at android.os.AsyncTask.finish(AsyncTask.java:417)
11-16 21:56:27.841: E/AndroidRuntime(794): at android.os.AsyncTask.access$300(AsyncTask.java:127)
11-16 21:56:27.841: E/AndroidRuntime(794): at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:429)
11-16 21:56:27.841: E/AndroidRuntime(794): at android.os.Handler.dispatchMessage(Handler.java:99)
11-16 21:56:27.841: E/AndroidRuntime(794): at android.os.Looper.loop(Looper.java:123)
11-16 21:56:27.841: E/AndroidRuntime(794): at android.app.ActivityThread.main(ActivityThread.java:4627)
11-16 21:56:27.841: E/AndroidRuntime(794): at java.lang.reflect.Method.invokeNative(Native Method)
11-16 21:56:27.841: E/AndroidRuntime(794): at java.lang.reflect.Method.invoke(Method.java:521)
11-16 21:56:27.841: E/AndroidRuntime(794): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
11-16 21:56:27.841: E/AndroidRuntime(794): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
11-16 21:56:27.841: E/AndroidRuntime(794): at dalvik.system.NativeStart.main(Native Method)

From the logcat:
Caused by: java.lang.NullPointerException
at com.example.test1.MainActivity$LoadAllSection.doInBackground(MainActivity.java:195)
And since you said this is line 195:
sectionList.add(map1);
It simply means that sectionList is null, you forgot to initialize it with:
sectionList = new ArrayList<HashMap<String, String>>();
Ok, with your new LogCat the trouble starts with line 220, which appears to be:
spinner2.setAdapter(adapter2);
Once again sectionList is to blame, this error only occurs when you try to pass an adapter bound to a null dataset.

Related

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

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

App stopped unexpectedly when exited

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

Android First Application tutorial

I have created a app based on the android tutorial : http://developer.android.com/training/basics/firstapp/index.html
The code is exactly the same except the app name but the application is force closing.
06-24 16:19:22.279: E/Zygote(33): setreuid() failed. errno: 2
06-24 16:19:33.028: E/Zygote(33): setreuid() failed. errno: 17
06-24 16:19:34.568: E/BatteryService(62): usbOnlinePath not found
06-24 16:19:34.568: E/BatteryService(62): batteryVoltagePath not found
06-24 16:19:34.568: E/BatteryService(62): batteryTemperaturePath not found
06-24 16:19:34.588: E/SurfaceFlinger(62): Couldn't open /sys/power/wait_for_fb_sleep or /sys/power/wait_for_fb_wake
06-24 16:19:34.698: E/SensorService(62): couldn't open device for module sensors (Invalid argument)
06-24 16:19:39.449: E/System(62): Failure starting core service
06-24 16:19:39.449: E/System(62): java.lang.SecurityException
06-24 16:19:39.449: E/System(62): at android.os.BinderProxy.transact(Native Method)
06-24 16:19:39.449: E/System(62): at android.os.ServiceManagerProxy.addService(ServiceManagerNative.java:146)
06-24 16:19:39.449: E/System(62): at android.os.ServiceManager.addService(ServiceManager.java:72)
06-24 16:19:39.449: E/System(62): at com.android.server.ServerThread.run(SystemServer.java:206)
06-24 16:19:39.479: E/EventHub(62): could not get driver version for /dev/input/mouse0, Not a typewriter
06-24 16:19:39.479: E/EventHub(62): could not get driver version for /dev/input/mice, Not a typewriter
06-24 16:19:39.808: E/SoundPool(62): error loading /system/media/audio/ui/Effect_Tick.ogg
06-24 16:19:39.808: E/SoundPool(62): error loading /system/media/audio/ui/KeypressStandard.ogg
06-24 16:19:39.808: E/SoundPool(62): error loading /system/media/audio/ui/KeypressSpacebar.ogg
06-24 16:19:39.808: E/SoundPool(62): error loading /system/media/audio/ui/KeypressDelete.ogg
06-24 16:19:39.808: E/SoundPool(62): error loading /system/media/audio/ui/KeypressReturn.ogg
06-24 16:19:39.828: E/UsbObserver(62): java.lang.NullPointerException
06-24 16:19:39.828: E/UsbObserver(62): at com.android.server.UsbObserver.init(UsbObserver.java:131)
06-24 16:19:39.828: E/UsbObserver(62): at com.android.server.UsbObserver.<init>(UsbObserver.java:65)
06-24 16:19:39.828: E/UsbObserver(62): at com.android.server.ServerThread.run(SystemServer.java:402)
06-24 16:19:40.429: E/ThrottleService(62): Could not open GPS configuration file /etc/gps.conf
06-24 16:19:40.958: E/logwrapper(137): executing /system/bin/tc failed: No such file or directory
06-24 16:19:41.069: E/logwrapper(139): executing /system/bin/tc failed: No such file or directory
06-24 16:19:41.129: E/logwrapper(144): executing /system/bin/tc failed: No such file or directory
06-24 16:37:58.420: E/AndroidRuntime(345): FATAL EXCEPTION: main
06-24 16:37:58.420: E/AndroidRuntime(345): java.lang.IllegalStateException: Could not execute method of the activity
06-24 16:37:58.420: E/AndroidRuntime(345): at android.view.View$1.onClick(View.java:2144)
06-24 16:37:58.420: E/AndroidRuntime(345): at android.view.View.performClick(View.java:2485)
06-24 16:37:58.420: E/AndroidRuntime(345): at android.view.View$PerformClick.run(View.java:9080)
06-24 16:37:58.420: E/AndroidRuntime(345): at android.os.Handler.handleCallback(Handler.java:587)
06-24 16:37:58.420: E/AndroidRuntime(345): at android.os.Handler.dispatchMessage(Handler.java:92)
06-24 16:37:58.420: E/AndroidRuntime(345): at android.os.Looper.loop(Looper.java:123)
06-24 16:37:58.420: E/AndroidRuntime(345): at android.app.ActivityThread.main(ActivityThread.java:3683)
06-24 16:37:58.420: E/AndroidRuntime(345): at java.lang.reflect.Method.invokeNative(Native Method)
06-24 16:37:58.420: E/AndroidRuntime(345): at java.lang.reflect.Method.invoke(Method.java:507)
06-24 16:37:58.420: E/AndroidRuntime(345): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
06-24 16:37:58.420: E/AndroidRuntime(345): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
06-24 16:37:58.420: E/AndroidRuntime(345): at dalvik.system.NativeStart.main(Native Method)
06-24 16:37:58.420: E/AndroidRuntime(345): Caused by: java.lang.reflect.InvocationTargetException
06-24 16:37:58.420: E/AndroidRuntime(345): at java.lang.reflect.Method.invokeNative(Native Method)
06-24 16:37:58.420: E/AndroidRuntime(345): at java.lang.reflect.Method.invoke(Method.java:507)
06-24 16:37:58.420: E/AndroidRuntime(345): at android.view.View$1.onClick(View.java:2139)
06-24 16:37:58.420: E/AndroidRuntime(345): ... 11 more
06-24 16:37:58.420: E/AndroidRuntime(345): Caused by: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.myfirstapp/DisplayMessageActivity.java.DisplayMessageActivity}; have you declared this activity in your AndroidManifest.xml?
06-24 16:37:58.420: E/AndroidRuntime(345): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1405)
06-24 16:37:58.420: E/AndroidRuntime(345): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1379)
06-24 16:37:58.420: E/AndroidRuntime(345): at android.app.Activity.startActivityForResult(Activity.java:2827)
06-24 16:37:58.420: E/AndroidRuntime(345): at android.app.Activity.startActivity(Activity.java:2933)
06-24 16:37:58.420: E/AndroidRuntime(345): at com.myfirstapp.MyFirstActivity.sendMessage(MyFirstActivity.java:26)
06-24 16:37:58.420: E/AndroidRuntime(345): ... 14 more
06-24 16:38:47.529: E/AndroidRuntime(357): FATAL EXCEPTION: main
06-24 16:38:47.529: E/AndroidRuntime(357): java.lang.IllegalStateException: Could not execute method of the activity
06-24 16:38:47.529: E/AndroidRuntime(357): at android.view.View$1.onClick(View.java:2144)
06-24 16:38:47.529: E/AndroidRuntime(357): at android.view.View.performClick(View.java:2485)
06-24 16:38:47.529: E/AndroidRuntime(357): at android.view.View$PerformClick.run(View.java:9080)
06-24 16:38:47.529: E/AndroidRuntime(357): at android.os.Handler.handleCallback(Handler.java:587)
06-24 16:38:47.529: E/AndroidRuntime(357): at android.os.Handler.dispatchMessage(Handler.java:92)
06-24 16:38:47.529: E/AndroidRuntime(357): at android.os.Looper.loop(Looper.java:123)
06-24 16:38:47.529: E/AndroidRuntime(357): at android.app.ActivityThread.main(ActivityThread.java:3683)
06-24 16:38:47.529: E/AndroidRuntime(357): at java.lang.reflect.Method.invokeNative(Native Method)
06-24 16:38:47.529: E/AndroidRuntime(357): at java.lang.reflect.Method.invoke(Method.java:507)
06-24 16:38:47.529: E/AndroidRuntime(357): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
06-24 16:38:47.529: E/AndroidRuntime(357): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
06-24 16:38:47.529: E/AndroidRuntime(357): at dalvik.system.NativeStart.main(Native Method)
06-24 16:38:47.529: E/AndroidRuntime(357): Caused by: java.lang.reflect.InvocationTargetException
06-24 16:38:47.529: E/AndroidRuntime(357): at java.lang.reflect.Method.invokeNative(Native Method)
06-24 16:38:47.529: E/AndroidRuntime(357): at java.lang.reflect.Method.invoke(Method.java:507)
06-24 16:38:47.529: E/AndroidRuntime(357): at android.view.View$1.onClick(View.java:2139)
06-24 16:38:47.529: E/AndroidRuntime(357): ... 11 more
06-24 16:38:47.529: E/AndroidRuntime(357): Caused by: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.myfirstapp/DisplayMessageActivity.java.DisplayMessageActivity}; have you declared this activity in your AndroidManifest.xml?
06-24 16:38:47.529: E/AndroidRuntime(357): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1405)
06-24 16:38:47.529: E/AndroidRuntime(357): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1379)
06-24 16:38:47.529: E/AndroidRuntime(357): at android.app.Activity.startActivityForResult(Activity.java:2827)
06-24 16:38:47.529: E/AndroidRuntime(357): at android.app.Activity.startActivity(Activity.java:2933)
06-24 16:38:47.529: E/AndroidRuntime(357): at com.myfirstapp.MyFirstActivity.sendMessage(MyFirstActivity.java:26)
06-24 16:38:47.529: E/AndroidRuntime(357): ... 14 more
06-24 16:43:20.070: E/AndroidRuntime(385): FATAL EXCEPTION: main
06-24 16:43:20.070: E/AndroidRuntime(385): java.lang.IllegalStateException: Could not execute method of the activity
06-24 16:43:20.070: E/AndroidRuntime(385): at android.view.View$1.onClick(View.java:2144)
06-24 16:43:20.070: E/AndroidRuntime(385): at android.view.View.performClick(View.java:2485)
06-24 16:43:20.070: E/AndroidRuntime(385): at android.view.View$PerformClick.run(View.java:9080)
06-24 16:43:20.070: E/AndroidRuntime(385): at android.os.Handler.handleCallback(Handler.java:587)
06-24 16:43:20.070: E/AndroidRuntime(385): at android.os.Handler.dispatchMessage(Handler.java:92)
06-24 16:43:20.070: E/AndroidRuntime(385): at android.os.Looper.loop(Looper.java:123)
06-24 16:43:20.070: E/AndroidRuntime(385): at android.app.ActivityThread.main(ActivityThread.java:3683)
06-24 16:43:20.070: E/AndroidRuntime(385): at java.lang.reflect.Method.invokeNative(Native Method)
06-24 16:43:20.070: E/AndroidRuntime(385): at java.lang.reflect.Method.invoke(Method.java:507)
06-24 16:43:20.070: E/AndroidRuntime(385): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
06-24 16:43:20.070: E/AndroidRuntime(385): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
06-24 16:43:20.070: E/AndroidRuntime(385): at dalvik.system.NativeStart.main(Native Method)
06-24 16:43:20.070: E/AndroidRuntime(385): Caused by: java.lang.reflect.InvocationTargetException
06-24 16:43:20.070: E/AndroidRuntime(385): at java.lang.reflect.Method.invokeNative(Native Method)
06-24 16:43:20.070: E/AndroidRuntime(385): at java.lang.reflect.Method.invoke(Method.java:507)
06-24 16:43:20.070: E/AndroidRuntime(385): at android.view.View$1.onClick(View.java:2139)
06-24 16:43:20.070: E/AndroidRuntime(385): ... 11 more
06-24 16:43:20.070: E/AndroidRuntime(385): Caused by: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.myfirstapp/DisplayMessageActivity.java.DisplayMessageActivity}; have you declared this activity in your AndroidManifest.xml?
06-24 16:43:20.070: E/AndroidRuntime(385): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1405)
06-24 16:43:20.070: E/AndroidRuntime(385): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1379)
06-24 16:43:20.070: E/AndroidRuntime(385): at android.app.Activity.startActivityForResult(Activity.java:2827)
06-24 16:43:20.070: E/AndroidRuntime(385): at android.app.Activity.startActivity(Activity.java:2933)
06-24 16:43:20.070: E/AndroidRuntime(385): at com.myfirstapp.MyFirstActivity.sendMessage(MyFirstActivity.java:26)
06-24 16:43:20.070: E/AndroidRuntime(385): ... 14 more
06-24 16:45:09.099: E/AndroidRuntime(425): FATAL EXCEPTION: main
06-24 16:45:09.099: E/AndroidRuntime(425): java.lang.IllegalStateException: Could not execute method of the activity
06-24 16:45:09.099: E/AndroidRuntime(425): at android.view.View$1.onClick(View.java:2144)
06-24 16:45:09.099: E/AndroidRuntime(425): at android.view.View.performClick(View.java:2485)
06-24 16:45:09.099: E/AndroidRuntime(425): at android.view.View$PerformClick.run(View.java:9080)
06-24 16:45:09.099: E/AndroidRuntime(425): at android.os.Handler.handleCallback(Handler.java:587)
06-24 16:45:09.099: E/AndroidRuntime(425): at android.os.Handler.dispatchMessage(Handler.java:92)
06-24 16:45:09.099: E/AndroidRuntime(425): at android.os.Looper.loop(Looper.java:123)
06-24 16:45:09.099: E/AndroidRuntime(425): at android.app.ActivityThread.main(ActivityThread.java:3683)
06-24 16:45:09.099: E/AndroidRuntime(425): at java.lang.reflect.Method.invokeNative(Native Method)
06-24 16:45:09.099: E/AndroidRuntime(425): at java.lang.reflect.Method.invoke(Method.java:507)
06-24 16:45:09.099: E/AndroidRuntime(425): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
06-24 16:45:09.099: E/AndroidRuntime(425): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
06-24 16:45:09.099: E/AndroidRuntime(425): at dalvik.system.NativeStart.main(Native Method)
06-24 16:45:09.099: E/AndroidRuntime(425): Caused by: java.lang.reflect.InvocationTargetException
06-24 16:45:09.099: E/AndroidRuntime(425): at java.lang.reflect.Method.invokeNative(Native Method)
06-24 16:45:09.099: E/AndroidRuntime(425): at java.lang.reflect.Method.invoke(Method.java:507)
06-24 16:45:09.099: E/AndroidRuntime(425): at android.view.View$1.onClick(View.java:2139)
06-24 16:45:09.099: E/AndroidRuntime(425): ... 11 more
06-24 16:45:09.099: E/AndroidRuntime(425): Caused by: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.myfirstapp/DisplayMessageActivity.java.DisplayMessageActivity}; have you declared this activity in your AndroidManifest.xml?
06-24 16:45:09.099: E/AndroidRuntime(425): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1405)
06-24 16:45:09.099: E/AndroidRuntime(425): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1379)
06-24 16:45:09.099: E/AndroidRuntime(425): at android.app.Activity.startActivityForResult(Activity.java:2827)
06-24 16:45:09.099: E/AndroidRuntime(425): at android.app.Activity.startActivity(Activity.java:2933)
06-24 16:45:09.099: E/AndroidRuntime(425): at com.myfirstapp.MyFirstActivity.sendMessage(MyFirstActivity.java:26)
06-24 16:45:09.099: E/AndroidRuntime(425): ... 14 more
06-24 18:20:31.070: E/AndroidRuntime(464): FATAL EXCEPTION: main
06-24 18:20:31.070: E/AndroidRuntime(464): java.lang.IllegalStateException: Could not execute method of the activity
06-24 18:20:31.070: E/AndroidRuntime(464): at android.view.View$1.onClick(View.java:2144)
06-24 18:20:31.070: E/AndroidRuntime(464): at android.view.View.performClick(View.java:2485)
06-24 18:20:31.070: E/AndroidRuntime(464): at android.view.View$PerformClick.run(View.java:9080)
06-24 18:20:31.070: E/AndroidRuntime(464): at android.os.Handler.handleCallback(Handler.java:587)
06-24 18:20:31.070: E/AndroidRuntime(464): at android.os.Handler.dispatchMessage(Handler.java:92)
06-24 18:20:31.070: E/AndroidRuntime(464): at android.os.Looper.loop(Looper.java:123)
06-24 18:20:31.070: E/AndroidRuntime(464): at android.app.ActivityThread.main(ActivityThread.java:3683)
06-24 18:20:31.070: E/AndroidRuntime(464): at java.lang.reflect.Method.invokeNative(Native Method)
06-24 18:20:31.070: E/AndroidRuntime(464): at java.lang.reflect.Method.invoke(Method.java:507)
06-24 18:20:31.070: E/AndroidRuntime(464): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
06-24 18:20:31.070: E/AndroidRuntime(464): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
06-24 18:20:31.070: E/AndroidRuntime(464): at dalvik.system.NativeStart.main(Native Method)
06-24 18:20:31.070: E/AndroidRuntime(464): Caused by: java.lang.reflect.InvocationTargetException
06-24 18:20:31.070: E/AndroidRuntime(464): at java.lang.reflect.Method.invokeNative(Native Method)
06-24 18:20:31.070: E/AndroidRuntime(464): at java.lang.reflect.Method.invoke(Method.java:507)
06-24 18:20:31.070: E/AndroidRuntime(464): at android.view.View$1.onClick(View.java:2139)
06-24 18:20:31.070: E/AndroidRuntime(464): ... 11 more
06-24 18:20:31.070: E/AndroidRuntime(464): Caused by: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.myfirstapp/DisplayMessageActivity.java.DisplayMessageActivity}; have you declared this activity in your AndroidManifest.xml?
06-24 18:20:31.070: E/AndroidRuntime(464): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1405)
06-24 18:20:31.070: E/AndroidRuntime(464): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1379)
06-24 18:20:31.070: E/AndroidRuntime(464): at android.app.Activity.startActivityForResult(Activity.java:2827)
06-24 18:20:31.070: E/AndroidRuntime(464): at android.app.Activity.startActivity(Activity.java:2933)
06-24 18:20:31.070: E/AndroidRuntime(464): at com.myfirstapp.MyFirstActivity.sendMessage(MyFirstActivity.java:26)
06-24 18:20:31.070: E/AndroidRuntime(464): ... 14 more
06-24 18:25:12.590: E/AndroidRuntime(477): FATAL EXCEPTION: main
06-24 18:25:12.590: E/AndroidRuntime(477): java.lang.IllegalStateException: Could not execute method of the activity
06-24 18:25:12.590: E/AndroidRuntime(477): at android.view.View$1.onClick(View.java:2144)
06-24 18:25:12.590: E/AndroidRuntime(477): at android.view.View.performClick(View.java:2485)
06-24 18:25:12.590: E/AndroidRuntime(477): at android.view.View$PerformClick.run(View.java:9080)
06-24 18:25:12.590: E/AndroidRuntime(477): at android.os.Handler.handleCallback(Handler.java:587)
06-24 18:25:12.590: E/AndroidRuntime(477): at android.os.Handler.dispatchMessage(Handler.java:92)
06-24 18:25:12.590: E/AndroidRuntime(477): at android.os.Looper.loop(Looper.java:123)
06-24 18:25:12.590: E/AndroidRuntime(477): at android.app.ActivityThread.main(ActivityThread.java:3683)
06-24 18:25:12.590: E/AndroidRuntime(477): at java.lang.reflect.Method.invokeNative(Native Method)
06-24 18:25:12.590: E/AndroidRuntime(477): at java.lang.reflect.Method.invoke(Method.java:507)
06-24 18:25:12.590: E/AndroidRuntime(477): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
06-24 18:25:12.590: E/AndroidRuntime(477): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
06-24 18:25:12.590: E/AndroidRuntime(477): at dalvik.system.NativeStart.main(Native Method)
06-24 18:25:12.590: E/AndroidRuntime(477): Caused by: java.lang.reflect.InvocationTargetException
06-24 18:25:12.590: E/AndroidRuntime(477): at java.lang.reflect.Method.invokeNative(Native Method)
06-24 18:25:12.590: E/AndroidRuntime(477): at java.lang.reflect.Method.invoke(Method.java:507)
06-24 18:25:12.590: E/AndroidRuntime(477): at android.view.View$1.onClick(View.java:2139)
06-24 18:25:12.590: E/AndroidRuntime(477): ... 11 more
06-24 18:25:12.590: E/AndroidRuntime(477): Caused by: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.myfirstapp/DisplayMessageActivity.java.DisplayMessageActivity}; have you declared this activity in your AndroidManifest.xml?
06-24 18:25:12.590: E/AndroidRuntime(477): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1405)
06-24 18:25:12.590: E/AndroidRuntime(477): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1379)
06-24 18:25:12.590: E/AndroidRuntime(477): at android.app.Activity.startActivityForResult(Activity.java:2827)
06-24 18:25:12.590: E/AndroidRuntime(477): at android.app.Activity.startActivity(Activity.java:2933)
06-24 18:25:12.590: E/AndroidRuntime(477): at com.myfirstapp.MyFirstActivity.sendMessage(MyFirstActivity.java:26)
06-24 18:25:12.590: E/AndroidRuntime(477): ... 14 more
<code>
not sure as how to debug this app.
Please advice
Thanks
SSAMEERR
Unable to find explicit activity class
{com.myfirstapp/DisplayMessageActivity.java.DisplayMessageActivity};
have you declared this activity in your AndroidManifest.xml?
put the entry of the DisplayMessageActivity in manifest.......
it DisplayMessageActivity is first Activity use intent-filter other remove that.
<activity android:name=".DisplayMessageActivity" android:label="Demo App">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Add it to the DisplayMessageActivity manifest as
<application ... >
<activity android:name=".DisplayMessageActivity" />
...
</application>
The answer is in the logcat:
Caused by: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.myfirstapp/DisplayMessageActivity.java.DisplayMessageActivity}; have you declared this activity in your AndroidManifest.xml?
Declare the activity in your manifest like so (i.e. insert it somewhere between the <application> and </application> tags):
<activity android:name=".DisplayMessageActivity" />
This is a common beginners mistake... expect this error at least a couple more times before you get used to it. :)
Make sure your other activities in the project are added to the AndroidManifest.xml
You have to include your activity in Manifest like:
<activity android:name=".MyFirstActivity"
android:theme="#android:style/Theme.NoTitleBar">
</activity>

Get password from android account

I noticed from Android API, they have this method getPassword(Account account).
accountManager = AccountManager.get(this);
Account[] allGoogleAccounts = accountManager.getAccountsByType("com.google");
for (Account account : allGoogleAccounts)
{
System.out.println(accountManager.getPassword(account));
}
But I have this error:
11-16 10:49:08.986: WARN/System.err(5732): java.lang.SecurityException: caller uid 10039 is different than the authenticator's uid
11-16 10:49:09.038: WARN/System.err(5732): at android.os.Parcel.readException(Parcel.java:1247)
11-16 10:49:09.038: WARN/System.err(5732): at android.os.Parcel.readException(Parcel.java:1235)
11-16 10:49:09.045: WARN/System.err(5732): at android.accounts.IAccountManager$Stub$Proxy.getPassword(IAccountManager.java:415)
11-16 10:49:09.087: WARN/System.err(5732): at android.accounts.AccountManager.getPassword(AccountManager.java:277)
11-16 10:49:09.087: WARN/System.err(5732): at com.test.account.onCreate(account.java:30)
11-16 10:49:09.107: WARN/System.err(5732): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
11-16 10:49:09.107: WARN/System.err(5732): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
11-16 10:49:09.125: WARN/System.err(5732): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
11-16 10:49:09.125: WARN/System.err(5732): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
11-16 10:49:09.134: WARN/System.err(5732): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
11-16 10:49:09.156: WARN/System.err(5732): at android.os.Handler.dispatchMessage(Handler.java:99)
11-16 10:49:09.156: WARN/System.err(5732): at android.os.Looper.loop(Looper.java:123)
11-16 10:49:09.166: WARN/System.err(5732): at android.app.ActivityThread.main(ActivityThread.java:4627)
11-16 10:49:09.175: WARN/System.err(5732): at java.lang.reflect.Method.invokeNative(Native Method)
11-16 10:49:09.185: WARN/System.err(5732): at java.lang.reflect.Method.invoke(Method.java:521)
11-16 10:49:09.185: WARN/System.err(5732): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
11-16 10:49:09.195: WARN/System.err(5732): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
11-16 10:49:09.206: WARN/System.err(5732): at dalvik.system.NativeStart.main(Native Method)
Anyone can tell me my mistake?
From AccountManager.getPassword()
getPassword:
This method requires the caller to hold the permission AUTHENTICATE_ACCOUNTS and to have the same UID as the account's authenticator.
The way I see it you can only get the password if your app was the app that created the account in account manager (Could be mistaking though)
in account manager if you(your app) write the account then only you(your app) can get the password this is because of security that on app could get the password of the user that he used to sync in other app
you can get the password of the account the is created by your process UID every process have it own UID once it runs on the device and continue to have the same UID ever

Using ViewGroup throws NullPointerException

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

Categories

Resources