Byte array image to bitmap - android

I'm trying to convert the byte array image to bitmap, but after conversion it gives me black image, why?
// Camera arg conversion to Bitmap
Bitmap cameraBitmap = BitmapFactory.decodeByteArray(arg0, 0,
arg0.length);
Bitmap background = Bitmap.createBitmap(cameraBitmap.getWidth(),
cameraBitmap.getHeight(), Bitmap.Config.ARGB_8888);
I want the camera image converted to bitmap. Any suggestion. Thanks in advance!!
07-17 02:22:18.149: E/AndroidRuntime(398): FATAL EXCEPTION: main
07-17 02:22:18.149: E/AndroidRuntime(398): java.lang.IllegalArgumentException: only support ImageFormat.NV21 and ImageFormat.YUY2 for now
07-17 02:22:18.149: E/AndroidRuntime(398): at android.graphics.YuvImage.<init>(YuvImage.java:82)
07-17 02:22:18.149: E/AndroidRuntime(398): at com.exercise.AndroidCamera.AndroidCamera$4.onPictureTaken(AndroidCamera.java:225)
07-17 02:22:18.149: E/AndroidRuntime(398): at android.hardware.Camera$EventHandler.handleMessage(Camera.java:320)
07-17 02:22:18.149: E/AndroidRuntime(398): at android.os.Handler.dispatchMessage(Handler.java:99)
07-17 02:22:18.149: E/AndroidRuntime(398): at android.os.Looper.loop(Looper.java:123)
07-17 02:22:18.149: E/AndroidRuntime(398): at android.app.ActivityThread.main(ActivityThread.java:4627)
07-17 02:22:18.149: E/AndroidRuntime(398): at java.lang.reflect.Method.invokeNative(Native Method)
07-17 02:22:18.149: E/AndroidRuntime(398): at java.lang.reflect.Method.invoke(Method.java:521)
07-17 02:22:18.149: E/AndroidRuntime(398): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
07-17 02:22:18.149: E/AndroidRuntime(398): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
07-17 02:22:18.149: E/AndroidRuntime(398): at dalvik.system.NativeStart.main(Native Method)

Unfortunately, the camera's image format is not ARGB_8888. Most likely it's something like YUV420p or maybe even the JPEG-compressed data.
First of all, determine what is your case.
You have two options: for YUV (which is an interleaved format) use some conversion format and for JPEG create a memorystream for your arg0 array and read the Bitmap from it.
There are similar questions here: BitmapFactory null issue in android
And there is even a solution here: Android byte[] to image in Camera.onPreviewFrame
EDIT: you just have to mangle the bytes in your array a little.
This wiki article explains how to convert the YUV422/420 to YUY2, required by the Android API.
Search for the "Y'UV422 can also be expressed in YUY2 FourCC format code" substring there.

Related

Taking picture from non-activity

I am using dummy surface in my code.It's working fine in Canvas HD running 4.2.1 but when the same app is deployed on my nexus 5/S 3 it gives RunTimeException on camera.takepicture
Here's my code
{
camera = Camera.open(cameraId);
if (camera != null)
{
SurfaceView dummy = new SurfaceView(context);
try {
camera.setPreviewDisplay(dummy.getHolder());
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
camera.startPreview();
camera.takePicture(null, null, new PhotoHandler(context));
}
Logcat:
07-17 22:46:49.281: E/AndroidRuntime(481): FATAL EXCEPTION: main
07-17 22:46:49.281: E/AndroidRuntime(481): Process: com.example.ex, PID: 481
07-17 22:46:49.281: E/AndroidRuntime(481): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.ex/com.example.ex.MainActivity}: java.lang.RuntimeException: takePicture failed
07-17 22:46:49.281: E/AndroidRuntime(481): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2184)
07-17 22:46:49.281: E/AndroidRuntime(481): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233)
07-17 22:46:49.281: E/AndroidRuntime(481): at android.app.ActivityThread.access$800(ActivityThread.java:135)
07-17 22:46:49.281: E/AndroidRuntime(481): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
07-17 22:46:49.281: E/AndroidRuntime(481): at android.os.Handler.dispatchMessage(Handler.java:102)
07-17 22:46:49.281: E/AndroidRuntime(481): at android.os.Looper.loop(Looper.java:136)
07-17 22:46:49.281: E/AndroidRuntime(481): at android.app.ActivityThread.main(ActivityThread.java:5001)
07-17 22:46:49.281: E/AndroidRuntime(481): at java.lang.reflect.Method.invokeNative(Native Method)
07-17 22:46:49.281: E/AndroidRuntime(481): at java.lang.reflect.Method.invoke(Method.java:515)
07-17 22:46:49.281: E/AndroidRuntime(481): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
07-17 22:46:49.281: E/AndroidRuntime(481): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
07-17 22:46:49.281: E/AndroidRuntime(481): at dalvik.system.NativeStart.main(Native Method)
07-17 22:46:49.281: E/AndroidRuntime(481): Caused by: java.lang.RuntimeException: takePicture failed
07-17 22:46:49.281: E/AndroidRuntime(481): at android.hardware.Camera.native_takePicture(Native Method)
07-17 22:46:49.281: E/AndroidRuntime(481): at android.hardware.Camera.takePicture(Camera.java:1245)
07-17 22:46:49.281: E/AndroidRuntime(481): at android.hardware.Camera.takePicture(Camera.java:1190)
07-17 22:46:49.281: E/AndroidRuntime(481): at com.example.ex.MainActivity.capturephoto(MainActivity.java:63)
07-17 22:46:49.281: E/AndroidRuntime(481): at com.example.ex.MainActivity.onCreate(MainActivity.java:26)
07-17 22:46:49.281: E/AndroidRuntime(481): at android.app.Activity.performCreate(Activity.java:5231)
07-17 22:46:49.281: E/AndroidRuntime(481): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
07-17 22:46:49.281: E/AndroidRuntime(481): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2148)
After googling and searching many questions on stackoverflow I found this and this but both snippets are used in activties .
How could I use such code in my app so that I can capture picture from background
You can use a dummy SurfaceTexture instead of a SurfaceView. This is reliable and works fine on the old camera API:
mDummyTexture = new SurfaceTexture(1); // pick a random argument for texture id
mCamera.setPreviewTexture(mDummyTexture);
mCamera.startPreview();
mCamera.takePicture(...);
Just make sure to keep mDummyTexture as a member of your class, or you may get abandoned surface errors.
As long as you don't call SurfaceTexture#updateTexImage(), you do not need an OpenGL context.
You shouldn't use a dummy SurfaceView as Android checks is the SurfaceView is displayed on the screen.
Instead, display the preview on a SurfaceView with WindowManager, with type SYSTEM_OVERLAY. Set your SurfaceView width and height to 1px and the opacity to 0 to hide the preview, and that's it!
If you plan to support only 5.0+ devices, or it's a new app that won't be available too soon, you should consider using the new android Camera2 API, which fixed many mistakes of the older API.
Hope it will help you :)
This is not possible, you need an activity to display the camera in.
Consider a transparent activity that just holds the camera view.

android camera failed when using the camera api

I'm having trouble taking a picture in android using the camera api. Using the camera intent seems to work fine, but not when I call the api directly.
Error:
java.lang.RuntimeException: takePicture failed at android.hardware.Camera.native_takePicture
Code
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
cameraId = findFrontFacingCamera();
camera = Camera.open(cameraId);
Parameters params = camera.getParameters();
SurfaceView dummy=new SurfaceView(context);
try {
camera.setPreviewDisplay(dummy.getHolder());
camera.startPreview();
camera.takePicture(null, photoHandler, photoHandler);
} catch (IOException e) {
camera.stopPreview();
camera.release();
}
}
private PictureCallback photoHandler = new PictureCallback() {
#Override
public void onPictureTaken(byte[] data, Camera camera) {
}
}
Manifest
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<uses-feature android:name="android.hardware.camera"/>
<uses-feature android:name="android.hardware.camera.autofocus" />
log cat output
07-17 10:16:02.523: D/MakePhotoActivity(14591): Camera found
07-17 10:16:02.773: D/dalvikvm(14591): threadid=1: still suspended after undo (sc=1 dc=1)
07-17 10:16:18.229: D/AndroidRuntime(14591): Shutting down VM
07-17 10:16:18.229: W/dalvikvm(14591): threadid=1: thread exiting with uncaught exception (group=0x40c4f930)
07-17 10:16:18.309: E/AndroidRuntime(14591): FATAL EXCEPTION: main
07-17 10:16:18.309: E/AndroidRuntime(14591): java.lang.RuntimeException: Unable to start activity ComponentInfo{tv.fakelove.stationtostation/tv.fakelove.stationtostation.MainActivity}: java.lang.RuntimeException: takePicture failed
07-17 10:16:18.309: E/AndroidRuntime(14591): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2180)
07-17 10:16:18.309: E/AndroidRuntime(14591): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
07-17 10:16:18.309: E/AndroidRuntime(14591): at android.app.ActivityThread.access$600(ActivityThread.java:141)
07-17 10:16:18.309: E/AndroidRuntime(14591): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
07-17 10:16:18.309: E/AndroidRuntime(14591): at android.os.Handler.dispatchMessage(Handler.java:99)
07-17 10:16:18.309: E/AndroidRuntime(14591): at android.os.Looper.loop(Looper.java:137)
07-17 10:16:18.309: E/AndroidRuntime(14591): at android.app.ActivityThread.main(ActivityThread.java:5041)
07-17 10:16:18.309: E/AndroidRuntime(14591): at java.lang.reflect.Method.invokeNative(Native Method)
07-17 10:16:18.309: E/AndroidRuntime(14591): at java.lang.reflect.Method.invoke(Method.java:511)
07-17 10:16:18.309: E/AndroidRuntime(14591): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
07-17 10:16:18.309: E/AndroidRuntime(14591): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
07-17 10:16:18.309: E/AndroidRuntime(14591): at dalvik.system.NativeStart.main(Native Method)
07-17 10:16:18.309: E/AndroidRuntime(14591): Caused by: java.lang.RuntimeException: takePicture failed
07-17 10:16:18.309: E/AndroidRuntime(14591): at android.hardware.Camera.native_takePicture(Native Method)
07-17 10:16:18.309: E/AndroidRuntime(14591): at android.hardware.Camera.takePicture(Camera.java:1095)
07-17 10:16:18.309: E/AndroidRuntime(14591): at android.hardware.Camera.takePicture(Camera.java:1040)
07-17 10:16:18.309: E/AndroidRuntime(14591): at tv.fakelove.stationtostation.MainActivity.onCreate(MainActivity.java:59)
07-17 10:16:18.309: E/AndroidRuntime(14591): at android.app.Activity.performCreate(Activity.java:5104)
07-17 10:16:18.309: E/AndroidRuntime(14591): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
07-17 10:16:18.309: E/AndroidRuntime(14591): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
Check out the answer provided in a previous question: Android: "Camera.takePicture failed" Exception
Apparently you need to start the preview before taking a photo, which includes setting a valid preview surface (which I don't think you are doing).
Also, check out step 5-6 laid out at http://developer.android.com/reference/android/hardware/Camera.html
Obtain an instance of Camera from open(int).
Get existing (default) settings with getParameters().
If necessary, modify the returned Camera.Parameters object and call setParameters(Camera.Parameters).
If desired, call setDisplayOrientation(int).
Important: Pass a fully initialized SurfaceHolder to setPreviewDisplay(SurfaceHolder). Without a surface, the camera will
be unable to start the preview.
Important: Call startPreview() to start updating the preview surface. Preview must be started before you can take a picture.
When you want, call takePicture(Camera.ShutterCallback, Camera.PictureCallback, Camera.PictureCallback,
Camera.PictureCallback) to capture a photo. Wait for the callbacks to
provide the actual image data.
After taking a picture, preview display will have stopped. To take more photos, call startPreview() again first.
Call stopPreview() to stop updating the preview surface.
Important: Call release() to release the camera for use by other applications. Applications should release the camera immediately in
onPause() (and re-open() it in onResume()).
One thought - as you're using a dummy SurfaceView, would you need to set the width / height of the SurfaceView, to match the width / height of the preview size of the Camera?
Without the full stack trace, there's not a whole lot more I can discern that's wrong with your code.

Lib not found error in tesseract [closed]

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.
Closed 10 years ago.
I am working with OCR android. Got samples from googling and work with android tesseract. I have the project as library and refered in another project but, when I run the project it shows the following in Logcat
07-17 10:38:47.092: ERROR/AndroidRuntime(426): FATAL EXCEPTION: main
07-17 10:38:47.092: ERROR/AndroidRuntime(426): java.lang.ExceptionInInitializerError
07-17 10:38:47.092: ERROR/AndroidRuntime(426): at com.imagetotext.ImagetoText.onCreate(ImagetoText.java:21)
07-17 10:38:47.092: ERROR/AndroidRuntime(426): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
07-17 10:38:47.092: ERROR/AndroidRuntime(426): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
07-17 10:38:47.092: ERROR/AndroidRuntime(426): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
07-17 10:38:47.092: ERROR/AndroidRuntime(426): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
07-17 10:38:47.092: ERROR/AndroidRuntime(426): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
07-17 10:38:47.092: ERROR/AndroidRuntime(426): at android.os.Handler.dispatchMessage(Handler.java:99)
07-17 10:38:47.092: ERROR/AndroidRuntime(426): at android.os.Looper.loop(Looper.java:123)
07-17 10:38:47.092: ERROR/AndroidRuntime(426): at android.app.ActivityThread.main(ActivityThread.java:4627)
07-17 10:38:47.092: ERROR/AndroidRuntime(426): at java.lang.reflect.Method.invokeNative(Native Method)
07-17 10:38:47.092: ERROR/AndroidRuntime(426): at java.lang.reflect.Method.invoke(Method.java:521)
07-17 10:38:47.092: ERROR/AndroidRuntime(426): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
07-17 10:38:47.092: ERROR/AndroidRuntime(426): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
07-17 10:38:47.092: ERROR/AndroidRuntime(426): at dalvik.system.NativeStart.main(Native Method)
07-17 10:38:47.092: ERROR/AndroidRuntime(426): Caused by: java.lang.UnsatisfiedLinkError: Library liblept not found
07-17 10:38:47.092: ERROR/AndroidRuntime(426): at java.lang.Runtime.loadLibrary(Runtime.java:461)
07-17 10:38:47.092: ERROR/AndroidRuntime(426): at java.lang.System.loadLibrary(System.java:557)
07-17 10:38:47.092: ERROR/AndroidRuntime(426): at com.googlecode.tesseract.android.TessBaseAPI.<clinit>(TessBaseAPI.java:47)
07-17 10:38:47.092: ERROR/AndroidRuntime(426): ... 14 more
07-17 10:38:47.112: WARN/ActivityManager(60): Force finishing activity com.imagetotext/.ImagetoText
I think there is something wrong with my android.mk. Please help me fix the error.
Exception cause line is,
System.loadLibrary(“lept”);
The problem is liblept.so (shared library) file can not found on specific library path. Without seeing your code just only assumption is your code trying to load shared library liblept.so and the library is not available at that path.
Also the code you are using is either have that liblept.so file in any lib or internal package directory or you have to generate (build) that shared library by using Android-NDK.

Avoiding fragment duplicates (App crushes due to the id property of the fragment)

There can be several instances of the same Activity in the task. My problem is that when I declare header-fragment like this:
<fragment
android:name="fragments.TabletHeader"
android:layout_width="match_parent"
android:layout_height="56dp"
android:id="#+id/header" />
it stumbles on the second creation of the same activity. This is, I guess, because this static declaration forces system to create second insance of the same fragment which is not allowed. Am I right ?
What are the tactics for solving this issue. Essentially I need to switch to the dynamic approach but how do I find out whether fragment already exists. Show me some examples, please.
Here's the backtrace:
07-17 14:34:34.593: E/AndroidRuntime(15546): android.view.InflateException: Binary XML file line #7: Error inflating class fragment
07-17 14:34:34.593: E/AndroidRuntime(15546): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:697)
07-17 14:34:34.593: E/AndroidRuntime(15546): at android.view.LayoutInflater.rInflate(LayoutInflater.java:739)
07-17 14:34:34.593: E/AndroidRuntime(15546): at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
07-17 14:34:34.593: E/AndroidRuntime(15546): at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
07-17 14:34:34.593: E/AndroidRuntime(15546): at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
07-17 14:34:34.593: E/AndroidRuntime(15546): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:273)
07-17 14:34:34.593: E/AndroidRuntime(15546): at android.app.Activity.setContentView(Activity.java:1835)
07-17 14:34:34.593: E/AndroidRuntime(15546): at android.activity.MainActivity$1.dispatchMessage(MainActivity.java:112)
07-17 14:34:34.593: E/AndroidRuntime(15546): at android.os.Looper.loop(Looper.java:137)
07-17 14:34:34.593: E/AndroidRuntime(15546): at android.app.ActivityThread.main(ActivityThread.java:4514)
07-17 14:34:34.593: E/AndroidRuntime(15546): at java.lang.reflect.Method.invokeNative(Native Method)
07-17 14:34:34.593: E/AndroidRuntime(15546): at java.lang.reflect.Method.invoke(Method.java:511)
07-17 14:34:34.593: E/AndroidRuntime(15546): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:790)
07-17 14:34:34.593: E/AndroidRuntime(15546): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:557)
07-17 14:34:34.593: E/AndroidRuntime(15546): at dalvik.system.NativeStart.main(Native Method)
07-17 14:34:34.593: E/AndroidRuntime(15546): Caused by: java.lang.IllegalArgumentException: Binary XML file line #7: Duplicate id 0x7f08000e, tag null, or parent id 0x0 with another fragment for android.fragments.TabletHeader
07-17 14:34:34.593: E/AndroidRuntime(15546): at android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:275)
07-17 14:34:34.593: E/AndroidRuntime(15546): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:669)
07-17 14:34:34.593: E/AndroidRuntime(15546): ... 14 more
I have not been using fragments from XML, but have used the viewpager enough to see a lifetime of issues. One suggestion I can make for you to look into is the Tag that is set. I know the format of the tag when a FrameAdapter is used. When adding using a transaction, you can define your own tag. In the case of xml, I suspect that the Tag may be the Name parameter.
So, you can use the findFragmentByTag(String tag) function and try to use the value of the Name field. If this gives you a valid fragment, you are all set.
Hope this helps. Again, the answer is an assumption which you can try.
EDIT:Another option may be to look into findFragmentById(R.id.header)

Trouble with Android App Uncaught Exceptions in the Log

When I launch my app I get the following errors in the log. Can you anyone decipher some of them for me, and give me a potential solution? I would be so grateful if you could as its proving very frustrating and I am new to Android development. I am using Eclipse SDK with an Android AVD at 1.6 SDK level.
Thanks..
07-17 11:05:57.046:
ERROR/AndroidRuntime(226): Uncaught
handler: thread main exiting due to
uncaught exception 07-17
11:05:57.056:
ERROR/AndroidRuntime(226):
java.lang.RuntimeException: Unable to
start activity
ComponentInfo{com.darius.android.distractions/com.darius.android.distractions.Distractions}:
java.lang.ClassCastException:
android.widget.FrameLayout 07-17
11:05:57.056:
ERROR/AndroidRuntime(226): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2401)
07-17 11:05:57.056:
ERROR/AndroidRuntime(226): at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2417)
07-17 11:05:57.056:
ERROR/AndroidRuntime(226): at
android.app.ActivityThread.access$2100(ActivityThread.java:116)
07-17 11:05:57.056:
ERROR/AndroidRuntime(226): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)
07-17 11:05:57.056:
ERROR/AndroidRuntime(226): at
android.os.Handler.dispatchMessage(Handler.java:99)
07-17 11:05:57.056:
ERROR/AndroidRuntime(226): at
android.os.Looper.loop(Looper.java:123)
07-17 11:05:57.056:
ERROR/AndroidRuntime(226): at
android.app.ActivityThread.main(ActivityThread.java:4203)
07-17 11:05:57.056:
ERROR/AndroidRuntime(226): at
java.lang.reflect.Method.invokeNative(Native
Method) 07-17 11:05:57.056:
ERROR/AndroidRuntime(226): at
java.lang.reflect.Method.invoke(Method.java:521)
07-17 11:05:57.056:
ERROR/AndroidRuntime(226): at
com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:791)
07-17 11:05:57.056:
ERROR/AndroidRuntime(226): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)
07-17 11:05:57.056:
ERROR/AndroidRuntime(226): at
dalvik.system.NativeStart.main(Native
Method) 07-17 11:05:57.056:
ERROR/AndroidRuntime(226): Caused by:
java.lang.ClassCastException:
android.widget.FrameLayout 07-17
11:05:57.056:
ERROR/AndroidRuntime(226): at
com.darius.android.distractions.Distractions.onCreate(Distractions.java:87)
07-17 11:05:57.056:
ERROR/AndroidRuntime(226): at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)
07-17 11:05:57.056:
ERROR/AndroidRuntime(226): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2364)
07-17 11:05:57.056:
ERROR/AndroidRuntime(226): ... 11
more
Your problem is on line 87 of your Distractions class.
The error stack complaining of a ClassCastException which is thrown when a program attempts to cast an object to a type with which it is not compatible.
It looks like you are trying to cast a FrameLayout as something it is not.
Good tip for decoding the error stack, look for the line that says Caused by: This line will give you a reason for the error and the line below will show you where the error is happening and will include a line reference so you can easily find the problem.

Categories

Resources