Good day! Noob here on android java.
I've been searching the entire Stackoverflow and asking a lot of questions about Intent. This is probably the last post that I'm going to do because I've been flooding the StackOverFlow with redundant questions about Intent.
I don't want to be totally spoon fed so I created two quick android application. One for the main launcher and the second one is for the application to be called. I've added a button on my main launcher and below is my code for that button that seems to be correct base on this tutorial (https://www.youtube.com/watch?v=qurvm-E9AiU).
public void ClickMe(View v) {
Intent i=new Intent(this, com.idd.applicationtocall.MainActivity.class);
startActivity(i);
}
After launching, the application crashes once I click on the button. I don't know what's wrong. I've almost tried all of the recommended answers which I think is all working for them. Below is a download link of the two quick applications that I created. I don't want you to finish it because I won't learn anything from it. I just wanted you guys to tell me what am I missing, what did I do wrong or what I did not understand about the Intent function.
https://www.mediafire.com/?wflsmaah5n7x49y
I'm using Java Eclipse and BlueStacks for my emulator.
Below is the logcat:
08-26 15:22:11.197: E/dalvikvm(13823): Could not find class 'com.idd.applicationtocall.MainActivity', referenced from method com.idd.applicationtolaunch.MainActivity.ClickMe
08-26 15:22:11.197: W/dalvikvm(13823): VFY: unable to resolve const-class 1140 (Lcom/idd/applicationtocall/MainActivity;) in Lcom/idd/applicationtolaunch/MainActivity;
08-26 15:22:11.197: D/dalvikvm(13823): VFY: replacing opcode 0x1c at 0x0002
08-26 15:22:11.227: I/PGA(13823): New SOCKET connection: icationtolaunch (pid 13823, tid 13823)
08-26 15:22:14.897: D/AndroidRuntime(13823): Shutting down VM
08-26 15:22:14.897: W/dalvikvm(13823): threadid=1: thread exiting with uncaught exception (group=0xb2c00180)
08-26 15:22:14.897: I/Process(13823): Sending signal. PID: 13823 SIG: 9
08-26 15:22:14.897: D/AndroidRuntime(13823): procName from cmdline: com.idd.applicationtolaunch
08-26 15:22:14.897: E/AndroidRuntime(13823): in writeCrashedAppName, pkgName :com.idd.applicationtolaunch
08-26 15:22:14.897: D/AndroidRuntime(13823): file written successfully with content: com.idd.applicationtolaunch StringBuffer : ;com.idd.applicationtolaunch
08-26 15:22:14.897: E/AndroidRuntime(13823): FATAL EXCEPTION: main
08-26 15:22:14.897: E/AndroidRuntime(13823): java.lang.IllegalStateException: Could not execute method of the activity
08-26 15:22:14.897: E/AndroidRuntime(13823): at android.view.View$1.onClick(View.java:3044)
08-26 15:22:14.897: E/AndroidRuntime(13823): at android.view.View.performClick(View.java:3511)
08-26 15:22:14.897: E/AndroidRuntime(13823): at android.view.View$PerformClick.run(View.java:14105)
08-26 15:22:14.897: E/AndroidRuntime(13823): at android.os.Handler.handleCallback(Handler.java:605)
08-26 15:22:14.897: E/AndroidRuntime(13823): at android.os.Handler.dispatchMessage(Handler.java:92)
08-26 15:22:14.897: E/AndroidRuntime(13823): at android.os.Looper.loop(Looper.java:137)
08-26 15:22:14.897: E/AndroidRuntime(13823): at android.app.ActivityThread.main(ActivityThread.java:4424)
08-26 15:22:14.897: E/AndroidRuntime(13823): at java.lang.reflect.Method.invokeNative(Native Method)
08-26 15:22:14.897: E/AndroidRuntime(13823): at java.lang.reflect.Method.invoke(Method.java:511)
08-26 15:22:14.897: E/AndroidRuntime(13823): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:825)
08-26 15:23:39.927: E/dalvikvm(14122): Could not find class 'com.idd.applicationtocall.MainActivity', referenced from method com.idd.applicationtolaunch.MainActivity.ClickMe
08-26 15:23:39.927: W/dalvikvm(14122): VFY: unable to resolve const-class 1140 (Lcom/idd/applicationtocall/MainActivity;) in Lcom/idd/applicationtolaunch/MainActivity;
08-26 15:23:39.927: D/dalvikvm(14122): VFY: replacing opcode 0x1c at 0x0002
08-26 15:23:39.957: I/PGA(14122): New SOCKET connection: icationtolaunch (pid 14122, tid 14122)