I am making a application using QR code scanner via ZXIng IntentIntegrator. I am able to make it using following code
IntentIntegrator integrator = new IntentIntegrator(
HomeActivity.this);
integrator.initiateScan();
public void onActivityResult(int requestCode, int resultCode, Intent intent) {
IntentResult scanResult = IntentIntegrator.parseActivityResult(
requestCode, resultCode, intent);
if (scanResult != null) {
// handle scan result
Toast.makeText(getApplicationContext(),
"scan " + scanResult.getContents(), 1).show();
}
// else continue with any other code you need in the method
}
And it run on real device.
But when i try to run it on my other device(Samsung note 2). it gives me crash log.
03-06 19:10:19.940: E/AndroidRuntime(10325): FATAL EXCEPTION: main
03-06 19:10:19.940: E/AndroidRuntime(10325): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=com.aztecbarcodereader.zxing.client.android.SCAN cat=[android.intent.category.DEFAULT] flg=0x4080000 }
03-06 19:10:19.940: E/AndroidRuntime(10325): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1580)
03-06 19:10:19.940: E/AndroidRuntime(10325): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1431)
03-06 19:10:19.940: E/AndroidRuntime(10325): at android.app.Activity.startActivityForResult(Activity.java:3446)
03-06 19:10:19.940: E/AndroidRuntime(10325): at android.app.Activity.startActivityForResult(Activity.java:3407)
03-06 19:10:19.940: E/AndroidRuntime(10325): at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:817)
03-06 19:10:19.940: E/AndroidRuntime(10325): at com.aztecbarcodereader.zxing.integration.android.IntentIntegrator.startActivityForResult(IntentIntegrator.java:290)
03-06 19:10:19.940: E/AndroidRuntime(10325): at com.aztecbarcodereader.zxing.integration.android.IntentIntegrator.initiateScan(IntentIntegrator.java:274)
03-06 19:10:19.940: E/AndroidRuntime(10325): at com.aztecbarcodereader.zxing.integration.android.IntentIntegrator.initiateScan(IntentIntegrator.java:209)
03-06 19:10:19.940: E/AndroidRuntime(10325): at com.raa.jwelarydemo.HomeActivity$8.onClick(HomeActivity.java:241)
03-06 19:10:19.940: E/AndroidRuntime(10325): at android.view.View.performClick(View.java:4223)
03-06 19:10:19.940: E/AndroidRuntime(10325): at android.view.View$PerformClick.run(View.java:17275)
03-06 19:10:19.940: E/AndroidRuntime(10325): at android.os.Handler.handleCallback(Handler.java:615)
03-06 19:10:19.940: E/AndroidRuntime(10325): at android.os.Handler.dispatchMessage(Handler.java:92)
03-06 19:10:19.940: E/AndroidRuntime(10325): at android.os.Looper.loop(Looper.java:137)
03-06 19:10:19.940: E/AndroidRuntime(10325): at android.app.ActivityThread.main(ActivityThread.java:4898)
03-06 19:10:19.940: E/AndroidRuntime(10325): at java.lang.reflect.Method.invokeNative(Native Method)
03-06 19:10:19.940: E/AndroidRuntime(10325): at java.lang.reflect.Method.invoke(Method.java:511)
03-06 19:10:19.940: E/AndroidRuntime(10325): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1008)
03-06 19:10:19.940: E/AndroidRuntime(10325): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:775)
03-06 19:10:19.940: E/AndroidRuntime(10325): at dalvik.system.NativeStart.main(Native Method)
Why am I getting this exception?
One more thing when I try any market app on this device to use barcode it also have same problem.
I think I have to make some setting on my particular device. But I can't find a solution.
Where did you get the jar file that you are using? It seems as if it is not the official ZXing one.
Notice the action on your intent
com.aztecbarcodereader.zxing.client.android.SCAN
this does not match the action string that the official ZXing app uses, here is the real one:
com.google.zxing.client.android.SCAN
If you modified the IntentIntegrator.java file then you need to revert the changes and use the original source code. If you did not modify it then you need to go back to the official ZXing site and download a fresh copy of it, because the one you have appears to have been made(incorrectly) by someone else.
You can download the official one here: https://code.google.com/p/zxing/downloads/detail?name=ZXing-2.1.zip once you get the zip file open it up and inside the android-integration are the jarfiles that you need.
Related
I heard about RealmDb which is a convinient database that can replace sqlite on android platform.
im trying to get it working on my galaxy s2 android version 2.3
i use realm version 0.79.1
however i get the following massage:
03-06 12:26:24.820: E/AndroidRuntime(17507): FATAL EXCEPTION: main
03-06 12:26:24.820: E/AndroidRuntime(17507): java.lang.ExceptionInInitializerError
03-06 12:26:24.820: E/AndroidRuntime(17507): at io.realm.Realm.<init>(Realm.java:199)
03-06 12:26:24.820: E/AndroidRuntime(17507): at io.realm.Realm.createAndValidate(Realm.java:516)
03-06 12:26:24.820: E/AndroidRuntime(17507): at io.realm.Realm.create(Realm.java:480)
03-06 12:26:24.820: E/AndroidRuntime(17507): at io.realm.Realm.getInstance(Realm.java:397)
03-06 12:26:24.820: E/AndroidRuntime(17507): at io.realm.Realm.getInstance(Realm.java:359)
03-06 12:26:24.820: E/AndroidRuntime(17507): at io.realm.Realm.getInstance(Realm.java:340)
03-06 12:26:24.820: E/AndroidRuntime(17507): at com.project.peoples.PersonListActivity.addTestPersons(PersonListActivity.java:134)
03-06 12:26:24.820: E/AndroidRuntime(17507): at com.project.peoples.PersonListActivity.onCreate(PersonListActivity.java:34)
03-06 12:26:24.820: E/AndroidRuntime(17507): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
03-06 12:26:24.820: E/AndroidRuntime(17507): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1615)
03-06 12:26:24.820: E/AndroidRuntime(17507): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667)
03-06 12:26:24.820: E/AndroidRuntime(17507): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
03-06 12:26:24.820: E/AndroidRuntime(17507): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935)
03-06 12:26:24.820: E/AndroidRuntime(17507): at android.os.Handler.dispatchMessage(Handler.java:99)
03-06 12:26:24.820: E/AndroidRuntime(17507): at android.os.Looper.loop(Looper.java:123)
03-06 12:26:24.820: E/AndroidRuntime(17507): at android.app.ActivityThread.main(ActivityThread.java:3691)
03-06 12:26:24.820: E/AndroidRuntime(17507): at java.lang.reflect.Method.invokeNative(Native Method)
03-06 12:26:24.820: E/AndroidRuntime(17507): at java.lang.reflect.Method.invoke(Method.java:507)
03-06 12:26:24.820: E/AndroidRuntime(17507): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:847)
03-06 12:26:24.820: E/AndroidRuntime(17507): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:605)
03-06 12:26:24.820: E/AndroidRuntime(17507): at dalvik.system.NativeStart.main(Native Method)
03-06 12:26:24.820: E/AndroidRuntime(17507): Caused by: java.lang.UnsatisfiedLinkError: Couldn't load tightdb-jni: findLibrary returned null
03-06 12:26:24.820: E/AndroidRuntime(17507): at java.lang.Runtime.loadLibrary(Runtime.java:429)
03-06 12:26:24.820: E/AndroidRuntime(17507): at java.lang.System.loadLibrary(System.java:554)
03-06 12:26:24.820: E/AndroidRuntime(17507): at io.realm.internal.TightDB.loadLibrary(TightDB.java:144)
03-06 12:26:24.820: E/AndroidRuntime(17507): at io.realm.internal.SharedGroup.<clinit>(SharedGroup.java:34)
03-06 12:26:24.820: E/AndroidRuntime(17507): ... 21 more
the cause is the following line:
Realm realmDb=Realm.getInstance(this);
does anyone knows the cause and how to solve it (i found the folowing but didnt quite understand if it has anything to do with me as i dont use Gson at all
https://github.com/realm/realm-java/issues/620)
update: i have the native libraries inside the libs directory
update
i cahnged the location of the native .so files directories to be direcetlly under the libs directory, that i think solved the earlier problem but presented the following error code:
03-06 14:18:18.520: E/AndroidRuntime(20552): FATAL EXCEPTION: main
03-06 14:18:18.520: E/AndroidRuntime(20552): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.project.mishnayot/com.project.peoples.PersonListActivity}: io.realm.exceptions.RealmException: Could not find the initTable method in the generated io.realm.PersonRealmProxy class: Annotation processor may not have been executed.
03-06 14:18:18.520: E/AndroidRuntime(20552): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1651)
03-06 14:18:18.520: E/AndroidRuntime(20552): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667)
03-06 14:18:18.520: E/AndroidRuntime(20552): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
03-06 14:18:18.520: E/AndroidRuntime(20552): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935)
03-06 14:18:18.520: E/AndroidRuntime(20552): at android.os.Handler.dispatchMessage(Handler.java:99)
03-06 14:18:18.520: E/AndroidRuntime(20552): at android.os.Looper.loop(Looper.java:123)
03-06 14:18:18.520: E/AndroidRuntime(20552): at android.app.ActivityThread.main(ActivityThread.java:3691)
03-06 14:18:18.520: E/AndroidRuntime(20552): at java.lang.reflect.Method.invokeNative(Native Method)
03-06 14:18:18.520: E/AndroidRuntime(20552): at java.lang.reflect.Method.invoke(Method.java:507)
03-06 14:18:18.520: E/AndroidRuntime(20552): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:847)
03-06 14:18:18.520: E/AndroidRuntime(20552): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:605)
03-06 14:18:18.520: E/AndroidRuntime(20552): at dalvik.system.NativeStart.main(Native Method)
03-06 14:18:18.520: E/AndroidRuntime(20552): Caused by: io.realm.exceptions.RealmException: Could not find the initTable method in the generated io.realm.PersonRealmProxy class: Annotation processor may not have been executed.
03-06 14:18:18.520: E/AndroidRuntime(20552): at io.realm.Realm.initializeRealm(Realm.java:591)
03-06 14:18:18.520: E/AndroidRuntime(20552): at io.realm.Realm.createAndValidate(Realm.java:523)
03-06 14:18:18.520: E/AndroidRuntime(20552): at io.realm.Realm.create(Realm.java:480)
03-06 14:18:18.520: E/AndroidRuntime(20552): at io.realm.Realm.getInstance(Realm.java:397)
03-06 14:18:18.520: E/AndroidRuntime(20552): at io.realm.Realm.getInstance(Realm.java:359)
03-06 14:18:18.520: E/AndroidRuntime(20552): at io.realm.Realm.getInstance(Realm.java:340)
03-06 14:18:18.520: E/AndroidRuntime(20552): at com.project.peoples.PersonListActivity.addTestPersons(PersonListActivity.java:134)
03-06 14:18:18.520: E/AndroidRuntime(20552): at com.project.peoples.PersonListActivity.onCreate(PersonListActivity.java:34)
03-06 14:18:18.520: E/AndroidRuntime(20552): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
03-06 14:18:18.520: E/AndroidRuntime(20552): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1615)
Realm cannot find the native libraries for some reason. Are you using Android Studio or Eclipse. If you are using Eclipse, note that some extra setup is required as described here: http://realm.io/docs/java/0.79.0/#getting-started
I'm trying to do something similar to this post. But when I try it it throws a fatal exception.
03-06 16:48:23.421: W/dalvikvm(2300): VFY: unable to resolve exception class 748 (Lcom/google/zxing/ChecksumException;)
03-06 16:48:23.421: W/dalvikvm(2300): VFY: unable to find exception handler at addr 0xc
03-06 16:48:23.421: W/dalvikvm(2300): VFY: rejected Lcom/example/pfc/MainActivity;.onCameraFrame (Lorg/opencv/android/CameraBridgeViewBase$CvCameraViewFrame;)Lorg/opencv/core/Mat;
03-06 16:48:23.421: W/dalvikvm(2300): VFY: rejecting opcode 0x0d at 0x000c
03-06 16:48:23.421: W/dalvikvm(2300): VFY: rejected Lcom/example/pfc/MainActivity;.onCameraFrame (Lorg/opencv/android/CameraBridgeViewBase$CvCameraViewFrame;)Lorg/opencv/core/Mat;
03-06 16:48:23.421: W/dalvikvm(2300): Verifier rejected class Lcom/example/pfc/MainActivity;
03-06 16:48:23.421: W/dalvikvm(2300): Class init failed in newInstance call (Lcom/example/pfc/MainActivity;)
03-06 16:48:23.421: W/dalvikvm(2300): threadid=1: thread exiting with uncaught exception (group=0x416efd40)
03-06 16:48:23.424: E/AndroidRuntime(2300): FATAL EXCEPTION: main
03-06 16:48:23.424: E/AndroidRuntime(2300): Process: com.example.pfc, PID: 2300
03-06 16:48:23.424: E/AndroidRuntime(2300): java.lang.VerifyError: com/example/pfc/MainActivity
03-06 16:48:23.424: E/AndroidRuntime(2300): at java.lang.Class.newInstanceImpl(Native Method)
03-06 16:48:23.424: E/AndroidRuntime(2300): at java.lang.Class.newInstance(Class.java:1208)
03-06 16:48:23.424: E/AndroidRuntime(2300): at android.app.Instrumentation.newActivity(Instrumentation.java:1084)
03-06 16:48:23.424: E/AndroidRuntime(2300): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2126)
03-06 16:48:23.424: E/AndroidRuntime(2300): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2269)
03-06 16:48:23.424: E/AndroidRuntime(2300): at android.app.ActivityThread.access$800(ActivityThread.java:139)
03-06 16:48:23.424: E/AndroidRuntime(2300): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1210)
03-06 16:48:23.424: E/AndroidRuntime(2300): at android.os.Handler.dispatchMessage(Handler.java:102)
03-06 16:48:23.424: E/AndroidRuntime(2300): at android.os.Looper.loop(Looper.java:136)
03-06 16:48:23.424: E/AndroidRuntime(2300): at android.app.ActivityThread.main(ActivityThread.java:5102)
03-06 16:48:23.424: E/AndroidRuntime(2300): at java.lang.reflect.Method.invokeNative(Native Method)
03-06 16:48:23.424: E/AndroidRuntime(2300): at java.lang.reflect.Method.invoke(Method.java:515)
03-06 16:48:23.424: E/AndroidRuntime(2300): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
03-06 16:48:23.424: E/AndroidRuntime(2300): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
03-06 16:48:23.424: E/AndroidRuntime(2300): at dalvik.system.NativeStart.main(Native Method)
I though it was becase of minimun SDK version but no... Also I know the problem is in the onCameraFrame, because when I comment the try/catch, I can run the app. Any ideas?
Thanks.
Solved, the core.jar must be in the Libs folder...
i am developing an android app that shows Google map. My log cat is showing following errors. I am new in android development. Please help me out. Thanks
03-06 06:31:25.561: E/dalvikvm(2476): Could not find class 'com.example.mapdemo.BasicMapActivity', referenced from method com.example.mapdemo.MainActivity.<clinit>
03-06 06:31:26.253: E/AndroidRuntime(2476): FATAL EXCEPTION: main
03-06 06:31:26.253: E/AndroidRuntime(2476): java.lang.ExceptionInInitializerError
03-06 06:31:26.253: E/AndroidRuntime(2476): at java.lang.Class.newInstanceImpl(Native Method)
03-06 06:31:26.253: E/AndroidRuntime(2476): at java.lang.Class.newInstance(Class.java:1319)
03-06 06:31:26.253: E/AndroidRuntime(2476): at android.app.Instrumentation.newActivity(Instrumentation.java:1054)
03-06 06:31:26.253: E/AndroidRuntime(2476): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2097)
03-06 06:31:26.253: E/AndroidRuntime(2476): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
03-06 06:31:26.253: E/AndroidRuntime(2476): at android.app.ActivityThread.access$600(ActivityThread.java:141)
03-06 06:31:26.253: E/AndroidRuntime(2476): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
03-06 06:31:26.253: E/AndroidRuntime(2476): at android.os.Handler.dispatchMessage(Handler.java:99)
03-06 06:31:26.253: E/AndroidRuntime(2476): at android.os.Looper.loop(Looper.java:137)
03-06 06:31:26.253: E/AndroidRuntime(2476): at android.app.ActivityThread.main(ActivityThread.java:5041)
03-06 06:31:26.253: E/AndroidRuntime(2476): at java.lang.reflect.Method.invokeNative(Native Method)
03-06 06:31:26.253: E/AndroidRuntime(2476): at java.lang.reflect.Method.invoke(Method.java:511)
03-06 06:31:26.253: E/AndroidRuntime(2476): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
03-06 06:31:26.253: E/AndroidRuntime(2476): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
03-06 06:31:26.253: E/AndroidRuntime(2476): at dalvik.system.NativeStart.main(Native Method)
03-06 06:31:26.253: E/AndroidRuntime(2476): Caused by: java.lang.NoClassDefFoundError: com.example.mapdemo.BasicMapActivity
03-06 06:31:26.253: E/AndroidRuntime(2476): at com.example.mapdemo.MainActivity.<clinit>(MainActivity.java:98)
03-06 06:31:26.253: E/AndroidRuntime(2476): ... 15 more
You should include this<uses-library android:name="com.google.android.maps" /> in your application tag in the manifest and also include this permissions
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
Check if you have defined your activity "BasicMapActivity".
Check if it has also being included in the manifest.xml
Getting this exception in lohcat when trying to search into my edittext box.
when i am entering any latter in search box suddnly my application getting forced close and displays this exception.
03-06 10:38:31.433: E/AndroidRuntime(750): FATAL EXCEPTION: main
03-06 10:38:31.433: E/AndroidRuntime(750): java.lang.NullPointerException
03-06 10:38:31.433: E/AndroidRuntime(750): at android.widget.SimpleAdapter.getCount(SimpleAdapter.java:93)
03-06 10:38:31.433: E/AndroidRuntime(750): at android.widget.AdapterView.checkFocus(AdapterView.java:700)
03-06 10:38:31.433: E/AndroidRuntime(750): at android.widget.AdapterView$AdapterDataSetObserver.onInvalidated(AdapterView.java:823)
03-06 10:38:31.433: E/AndroidRuntime(750): at android.widget.AbsListView$AdapterDataSetObserver.onInvalidated(AbsListView.java:5600)
03-06 10:38:31.433: E/AndroidRuntime(750): at android.database.DataSetObservable.notifyInvalidated(DataSetObservable.java:47)
03-06 10:38:31.433: E/AndroidRuntime(750): at android.widget.BaseAdapter.notifyDataSetInvalidated(BaseAdapter.java:59)
03-06 10:38:31.433: E/AndroidRuntime(750): at android.widget.SimpleAdapter$SimpleFilter.publishResults(SimpleAdapter.java:383)
03-06 10:38:31.433: E/AndroidRuntime(750): at android.widget.Filter$ResultsHandler.handleMessage(Filter.java:282)
03-06 10:38:31.433: E/AndroidRuntime(750): at android.os.Handler.dispatchMessage(Handler.java:99)
03-06 10:38:31.433: E/AndroidRuntime(750): at android.os.Looper.loop(Looper.java:137)
03-06 10:38:31.433: E/AndroidRuntime(750): at android.app.ActivityThread.main(ActivityThread.java:4340)
03-06 10:38:31.433: E/AndroidRuntime(750): at java.lang.reflect.Method.invokeNative(Native Method)
03-06 10:38:31.433: E/AndroidRuntime(750): at java.lang.reflect.Method.invoke(Method.java:511)
03-06 10:38:31.433: E/AndroidRuntime(750): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
03-06 10:38:31.433: E/AndroidRuntime(750): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
03-06 10:38:31.433: E/AndroidRuntime(750): at dalvik.system.NativeStart.main(Native Method)
I have an activity lets say activity A.
public class ActivityA extends Activity{
static int id_original;
.
.
.
id_original = R.drawable.afra_o;
}
afra_o is the ImageView of another activity's layout. Lets say Activity B. In activity A, i want to set id_original to some drawable and then I want to change ImageView of B by referencing id_original in activity B.
public class ActivityB extends Activity {
ImageView view_correct = (ImageView)findViewById(R.id.image_original);
view_correct.setImageResource(ActivityA.id_original);
setContentView(R.layout.activity_B);
Like this one. But I got errors like this one
03-06 11:57:55.845: E/AndroidRuntime(10791): FATAL EXCEPTION: main
03-06 11:57:55.845: E/AndroidRuntime(10791): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.turkishlogoquiz/com.example.turkishlogoquiz.CorrectActivity}: java.lang.NullPointerException
03-06 11:57:55.845: E/AndroidRuntime(10791): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2100)
03-06 11:57:55.845: E/AndroidRuntime(10791): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2125)
03-06 11:57:55.845: E/AndroidRuntime(10791): at android.app.ActivityThread.access$600(ActivityThread.java:140)
03-06 11:57:55.845: E/AndroidRuntime(10791): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1227)
03-06 11:57:55.845: E/AndroidRuntime(10791): at android.os.Handler.dispatchMessage(Handler.java:99)
03-06 11:57:55.845: E/AndroidRuntime(10791): at android.os.Looper.loop(Looper.java:137)
03-06 11:57:55.845: E/AndroidRuntime(10791): at android.app.ActivityThread.main(ActivityThread.java:4898)
03-06 11:57:55.845: E/AndroidRuntime(10791): at java.lang.reflect.Method.invokeNative(Native Method)
03-06 11:57:55.845: E/AndroidRuntime(10791): at java.lang.reflect.Method.invoke(Method.java:511)
03-06 11:57:55.845: E/AndroidRuntime(10791): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1008)
03-06 11:57:55.845: E/AndroidRuntime(10791): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:775)
03-06 11:57:55.845: E/AndroidRuntime(10791): at dalvik.system.NativeStart.main(Native Method)
03-06 11:57:55.845: E/AndroidRuntime(10791): Caused by: java.lang.NullPointerException
03-06 11:57:55.845: E/AndroidRuntime(10791): at com.example.turkishlogoquiz.CorrectActivity.onCreate(CorrectActivity.java:20)
03-06 11:57:55.845: E/AndroidRuntime(10791): at android.app.Activity.performCreate(Activity.java:5206)
03-06 11:57:55.845: E/AndroidRuntime(10791): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1094)
03-06 11:57:55.845: E/AndroidRuntime(10791): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2064)
Any help, please.
It seems that ImageView view_correct = (ImageView)findViewById(R.id.image_original); returns null pointer. You can not call a findViewById() before you set content view by calling setContentView(R.layout.activity_B);.
Check this out : http://developer.android.com/reference/android/app/Activity.html
onCreate(Bundle) is where you initialize your activity. Most importantly, here you will usually call setContentView(int) with a layout resource defining your UI, and using findViewById(int) to retrieve the widgets in that UI that you need to interact with programmatically.
I handled the question. I used intent.putExtra to pass data from one activity to another. By using it, I manage to set image of Activity B according to Activity A dynamically. Thank you for the answers.