Error when developing native camera app for Shield tablet - android

I am developing a native application on my Nvidia Shield tablet to get camera frame. I download the Shield tutorial and I am using Eclipse.
I get the error:
01-09 08:45:35.475: I/art(9536): Late-enabling -Xcheck:jni
01-09 08:45:35.559: D/AndroidRuntime(9536): Shutting down VM
01-09 08:45:35.560: E/AndroidRuntime(9536): FATAL EXCEPTION: main
01-09 08:45:35.560: E/AndroidRuntime(9536): Process: com.nvidia.NativeCamera, PID: 9536
01-09 08:45:35.560: E/AndroidRuntime(9536): java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "_ZN7android11BufferQueueC1ERKNS_2spINS_19IGraphicBufferAllocEEE" referenced by "/data/app/com.nvidia.NativeCamera-1/lib/arm/libnative_camera2.so"...
01-09 08:45:35.560: E/AndroidRuntime(9536): at java.lang.Runtime.loadLibrary(Runtime.java:372)
01-09 08:45:35.560: E/AndroidRuntime(9536): at java.lang.System.loadLibrary(System.java:1076)
01-09 08:45:35.560: E/AndroidRuntime(9536): at com.nvidia.NativeCamera.NativeCamera.<clinit>(NativeCamera.java:23)
01-09 08:45:35.560: E/AndroidRuntime(9536): at java.lang.Class.newInstance(Native Method)
01-09 08:45:35.560: E/AndroidRuntime(9536): at android.app.Instrumentation.newActivity(Instrumentation.java:1067)
01-09 08:45:35.560: E/AndroidRuntime(9536): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2359)
01-09 08:45:35.560: E/AndroidRuntime(9536): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2518)
01-09 08:45:35.560: E/AndroidRuntime(9536): at android.app.ActivityThread.-wrap11(ActivityThread.java)
01-09 08:45:35.560: E/AndroidRuntime(9536): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1345)
01-09 08:45:35.560: E/AndroidRuntime(9536): at android.os.Handler.dispatchMessage(Handler.java:104)
01-09 08:45:35.560: E/AndroidRuntime(9536): at android.os.Looper.loop(Looper.java:148)
01-09 08:45:35.560: E/AndroidRuntime(9536): at android.app.ActivityThread.main(ActivityThread.java:5457)
01-09 08:45:35.560: E/AndroidRuntime(9536): at java.lang.reflect.Method.invoke(Native Method)
01-09 08:45:35.560: E/AndroidRuntime(9536): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
01-09 08:45:35.560: E/AndroidRuntime(9536): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
I don't really understand the reason of that error.
Here is my github :https://github.com/xav12358/nativeCamera
Can someone give me a hand?

I review your code, logcat line
java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "_ZN7android11BufferQueueC1ERKNS_2spINS_19IGraphicBufferAllocEEE" referenced by "/data/app/com.nvidia.NativeCamera-1/lib/arm/libnative_camera2.so"...
say that your libnative_camera2.so should be on lib/arm but on the repo libnative_camera2.so is at /libs/armeabi-v7a/libnative_camera2.so
Try to move libnative_camera2.so to lib/arm/
I hope It Helps !

Related

You tube playing only once

I'm able to play the you tube video only once i used the below link.
Video plays only once in Webview of Android
but my question is in that with in Chrome Client they asked to add below line
#Override public void onPrepared(MediaPlayer mp) {
customViewCallback.onCustomViewHidden();
}
to show video more than once but no luck. getting crash for that. below is the details of crash
any links or sample code helps me a lot thanks in advance
01-09 11:25:27.999: ERROR/MediaPlayer(3833): <!>android.media.MediaPlayer 732<!> IOException: java.io.FileNotFoundException: No content provider: http://r2---sn-ci5gup-cage.c.youtube.com/videoplayback?itag=18&yms=LMB29RrCiYc&gcr=in&fexp=906373%2C922206%2C901054%2C916624%2C920704%2C912806%2C928001%2C922403%2C922405%2C929901%2C913605%2C929104%2C929110%2C913546%2C913556%2C908493%2C908496%2C920201%2C913302%2C919009%2C911116%2C926403%2C901451%2C902556&app=youtube_mobile&newshard=yes&ratebypass=yes&cp=U0hUTFdOT19GTENONF9PSFNJOkpKQTU0VXFabVZh&ms=au&mv=m&el=watch&expire=1357731812&ip=223.239.139.176&key=yt1&sver=3&id=538eced585584e54&source=youtube&ipbits=8&sparams=cp%2Cgcr%2Cid%2Cip%2Cipbits%2Citag%2Cratebypass%2Csource%2Cupn%2Cexpire&mt=1357710850&signature=71FD38C03ABA06281CFF021A543051861ED0FEC3.A1F7E9E860349E8D3240D8156346C344FFA08731&dnc=1&upn=5y6eEl8pixM
01-09 11:25:28.009: ERROR/MediaPlayerService(1507): [MediaPlayerService::Client::setDataSource]player type = 4
01-09 11:25:29.069: ERROR/QCvdec(1507): Setparameter: unknown param 2130706451
01-09 11:25:31.099: ERROR/QCvdec(1507): Omx Flush issued when vdec is not initialized yet.
01-09 11:25:31.139: ERROR/AndroidRuntime(3833): FATAL EXCEPTION: main
01-09 11:25:31.139: ERROR/AndroidRuntime(3833): java.lang.NullPointerException
01-09 11:25:31.139: ERROR/AndroidRuntime(3833): at android.webkit.HTML5VideoViewProxy$VideoPlayer$2.surfaceDestroyed(HTML5VideoViewProxy.java:322)
01-09 11:25:31.139: ERROR/AndroidRuntime(3833): at android.view.SurfaceView.reportSurfaceDestroyed(SurfaceView.java:596)
01-09 11:25:31.139: ERROR/AndroidRuntime(3833): at android.view.SurfaceView.updateWindow(SurfaceView.java:490)
01-09 11:25:31.139: ERROR/AndroidRuntime(3833): at android.view.SurfaceView.onWindowVisibilityChanged(SurfaceView.java:215)
01-09 11:25:31.139: ERROR/AndroidRuntime(3833): at android.view.View.dispatchDetachedFromWindow(View.java:6169)
01-09 11:25:31.139: ERROR/AndroidRuntime(3833): at android.view.ViewGroup.removeViewInternal(ViewGroup.java:2201)
01-09 11:25:31.139: ERROR/AndroidRuntime(3833): at android.view.ViewGroup.removeViewInternal(ViewGroup.java:2187)
01-09 11:25:31.139: ERROR/AndroidRuntime(3833): at android.view.ViewGroup.removeView(ViewGroup.java:2135)
01-09 11:25:31.139: ERROR/AndroidRuntime(3833): at android.webkit.HTML5VideoViewProxy$VideoPlayer$1.onCustomViewHidden(HTML5VideoViewProxy.java:160)
01-09 11:25:31.139: ERROR/AndroidRuntime(3833): at com.android.rmtest.SocialMedia$chromeClient.onPrepared(SocialMedia.java:155)
01-09 11:25:31.139: ERROR/AndroidRuntime(3833): at android.widget.VideoView$2.onPrepared(VideoView.java:298)
01-09 11:25:31.139: ERROR/AndroidRuntime(3833): at android.media.MediaPlayer$EventHandler.handleMessage(MediaPlayer.java:1313)
01-09 11:25:31.139: ERROR/AndroidRuntime(3833): at android.os.Handler.dispatchMessage(Handler.java:99)
01-09 11:25:31.139: ERROR/AndroidRuntime(3833): at android.os.Looper.loop(Looper.java:130)
01-09 11:25:31.139: ERROR/AndroidRuntime(3833): at android.app.ActivityThread.main(ActivityThread.java:3737)
01-09 11:25:31.139: ERROR/AndroidRuntime(3833): at java.lang.reflect.Method.invokeNative(Native Method)
01-09 11:25:31.139: ERROR/AndroidRuntime(3833): at java.lang.reflect.Method.invoke(Method.java:507)
01-09 11:25:31.139: ERROR/AndroidRuntime(3833): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:902)
01-09 11:25:31.139: ERROR/AndroidRuntime(3833): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:660)
01-09 11:25:31.139: ERROR/AndroidRuntime(3833): at dalvik.system.NativeStart.main(Native Method)
01-09 11:25:31.139: ERROR/AndroidRuntime(3833): [Blue Error Handler] Make Debugging Report file for main
01-09 11:25:31.139: ERROR/AndroidRuntime(3833): java.lang.NullPointerException
01-09 11:25:31.139: ERROR/AndroidRuntime(3833): at android.webkit.HTML5VideoViewProxy$VideoPlayer$2.surfaceDestroyed(HTML5VideoViewProxy.java:322)
01-09 11:25:31.139: ERROR/AndroidRuntime(3833): at android.view.SurfaceView.reportSurfaceDestroyed(SurfaceView.java:596)
01-09 11:25:31.139: ERROR/AndroidRuntime(3833): at android.view.SurfaceView.updateWindow(SurfaceView.java:490)
01-09 11:25:31.139: ERROR/AndroidRuntime(3833): at android.view.SurfaceView.onWindowVisibilityChanged(SurfaceView.java:215)
01-09 11:25:31.139: ERROR/AndroidRuntime(3833): at android.view.View.dispatchDetachedFromWindow(View.java:6169)
01-09 11:25:31.139: ERROR/AndroidRuntime(3833): at android.view.ViewGroup.removeViewInternal(ViewGroup.java:2201)
01-09 11:25:31.139: ERROR/AndroidRuntime(3833): at android.view.ViewGroup.removeViewInternal(ViewGroup.java:2187)
01-09 11:25:31.139: ERROR/AndroidRuntime(3833): at android.view.ViewGroup.removeView(ViewGroup.java:2135)
01-09 11:25:31.139: ERROR/AndroidRuntime(3833): at android.webkit.HTML5VideoViewProxy$VideoPlayer$1.onCustomViewHidden(HTML5VideoViewProxy.java:160)
01-09 11:25:31.139: ERROR/AndroidRuntime(3833): at com.android.rmtest.SocialMedia$chromeClient.onPrepared(SocialMedia.java:155)
01-09 11:25:31.139: ERROR/AndroidRuntime(3833): at android.widget.VideoView$2.onPrepared(VideoView.java:298)
01-09 11:25:31.139: ERROR/AndroidRuntime(3833): at android.media.MediaPlayer$EventHandler.handleMessage(MediaPlayer.java:1313)
01-09 11:25:31.139: ERROR/AndroidRuntime(3833): at android.os.Handler.dispatchMessage(Handler.java:99)
01-09 11:25:31.139: ERROR/AndroidRuntime(3833): at android.os.Looper.loop(Looper.java:130)
01-09 11:25:31.139: ERROR/AndroidRuntime(3833): at android.app.ActivityThread.main(ActivityThread.java:3737)
01-09 11:25:31.139: ERROR/AndroidRuntime(3833): at java.lang.reflect.Method.invokeNative(Native Method)
01-09 11:25:31.139: ERROR/AndroidRuntime(3833): at java.lang.reflect.Method.invoke(Method.java:507)
01-09 11:25:31.139: ERROR/AndroidRuntime(3833): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:902)
01-09 11:25:31.139: ERROR/AndroidRuntime(3833): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:660)
01-09 11:25:31.139: ERROR/AndroidRuntime(3833): at dalvik.system.NativeStart.main(Native Method)

ResourceNotFoundException while trying to parse xml file in android

I'm trying to parse an xml file and extract data from it to display in my android app.
The xml file is as follows:
<?xml version="1.0" encoding="UTF-8"?>
<record>
<study id="1">
<topic>SAX Parser</topic>
<content>Learn how to parse XML using SAXParser</content>
<author>Pete Houston</author>
<date>02-Oct-2011</date>
</study>
The file is stored in res/raw folder. The android activity calls a function which tries to read the xml file and parses it to retrieve data,which is then stored into an object of type Study (defined by me). This object is then returned by the function.
The skeleton structure of my code is given below:
public class XmlParserActivity extends Activity {
Study study=null;
protected void onCreate(Bundle savedInstanceState) {
//...android code and some variable initializations
try{
study = parseXml(getResources().openRawResource(R.raw.record));
}catch(Exception e){
e.printStackTrace();
finish();
}
}
public Study parseXml(InputStream is){
//code for parsing the input stream
return study;
}
When I launch the app in an emulator it crashes and produces android.content.res.ResourcesNotFoundException. Is there something wrong with the way I am accessing the xml file? Or do I need to set some permissions in the AndroidManifest.xml file? I have searched this site and other sites but have not found a satisfactory solution to my problem. Any guidance will be deeply appreciated.
logcat messages:
01-09 15:49:55.801: I/Process(1152): Sending signal. PID: 1152 SIG: 9
01-09 15:50:04.174: E/Trace(1198): error opening trace file: No such file or directory(2)
01-09 15:50:04.992: W/ResourceType(1198): No package identifier when getting value for resource number 0x00000001
01-09 15:50:05.002: D/AndroidRuntime(1198): Shutting down VM
01-09 15:50:05.002: W/dalvikvm(1198): threadid=1: thread exiting with uncaught exception (group=0x40a13300)
01-09 15:50:05.012: E/AndroidRuntime(1198): FATAL EXCEPTION: main
01-09 15:50:05.012: E/AndroidRuntime(1198): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.androidxmlparser/com.example.androidxmlparser.XmlParserActivity}: android.content.res.Resources$NotFoundException: String resource ID #0x1
01-09 15:50:05.012: E/AndroidRuntime(1198): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2059)
01-09 15:50:05.012: E/AndroidRuntime(1198): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
01-09 15:50:05.012: E/AndroidRuntime(1198): at android.app.ActivityThread.access$600(ActivityThread.java:130)
01-09 15:50:05.012: E/AndroidRuntime(1198): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
01-09 15:50:05.012: E/AndroidRuntime(1198): at android.os.Handler.dispatchMessage(Handler.java:99)
01-09 15:50:05.012: E/AndroidRuntime(1198): at android.os.Looper.loop(Looper.java:137)
01-09 15:50:05.012: E/AndroidRuntime(1198): at android.app.ActivityThread.main(ActivityThread.java:4745)
01-09 15:50:05.012: E/AndroidRuntime(1198): at java.lang.reflect.Method.invokeNative(Native Method)
01-09 15:50:05.012: E/AndroidRuntime(1198): at java.lang.reflect.Method.invoke(Method.java:511)
01-09 15:50:05.012: E/AndroidRuntime(1198): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
01-09 15:50:05.012: E/AndroidRuntime(1198): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
01-09 15:50:05.012: E/AndroidRuntime(1198): at dalvik.system.NativeStart.main(Native Method)
01-09 15:50:05.012: E/AndroidRuntime(1198): Caused by: android.content.res.Resources$NotFoundException: String resource ID #0x1
01-09 15:50:05.012: E/AndroidRuntime(1198): at android.content.res.Resources.getText(Resources.java:229)
01-09 15:50:05.012: E/AndroidRuntime(1198): at android.widget.TextView.setText(TextView.java:3620)
01-09 15:50:05.012: E/AndroidRuntime(1198): at com.example.androidxmlparser.XmlParserActivity.onCreate(XmlParserActivity.java:34)
01-09 15:50:05.012: E/AndroidRuntime(1198): at android.app.Activity.performCreate(Activity.java:5008)
01-09 15:50:05.012: E/AndroidRuntime(1198): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
01-09 15:50:05.012: E/AndroidRuntime(1198): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)
01-09 15:50:05.012: E/AndroidRuntime(1198): ... 11 more
You're trying to access a string resource that cannot be found.
As Matt Taylor suggests, you should check line 34 of your activity, and find which string resource is wrong.
Further to fiddler's comment on your question, I've just seen what I think is the problem:
Your xml file just needs to contain:
<study id="1">
<topic>SAX Parser</topic>
<content>Learn how to parse XML using SAXParser</content>
<author>Pete Houston</author>
<date>02-Oct-2011</date>
</study>
And you access it using:
getResources().openRawResource(R.raw.<xml file name (without.xml)>);
For example, if it was called xmldata.xml you'd use R.raw.xmldata

Android: how to refer to EditText view

I have the following layout:
<TextView
android:id = "#+id/HRNoninTextBox"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/exitbtn"
android:text="Heart Rate"
android:textSize = "20sp"/>
<EditText
android:id="#+id/labelNoninHeartRate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="00"
android:layout_alignParentRight="true">
</EditText>
from the code i refer to these views, form my activity, in this way:
TextView tvHr= (TextView)findViewById(R.id.HRNoninTextBox);
EditText etHr = (EditText)findViewById(R.id.labelNoninHeartRate);
the first one does not produce any error, while the second statement produce the following error:
01-09 13:24:57.599: W/dalvikvm(28816): threadid=1: thread exiting with uncaught exception (group=0x4001e578)
01-09 13:24:57.619: E/AndroidRuntime(28816): FATAL EXCEPTION: main
01-09 13:24:57.619: E/AndroidRuntime(28816): java.lang.RuntimeException: Unable to start activity ComponentInfo{aid.assistant233/aid.assistant233.AidAssistant233Activity}: java.lang.ClassCastException: android.widget.TextView
01-09 13:24:57.619: E/AndroidRuntime(28816): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1651)
01-09 13:24:57.619: E/AndroidRuntime(28816): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667)
01-09 13:24:57.619: E/AndroidRuntime(28816): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
01-09 13:24:57.619: E/AndroidRuntime(28816): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935)
01-09 13:24:57.619: E/AndroidRuntime(28816): at android.os.Handler.dispatchMessage(Handler.java:99)
01-09 13:24:57.619: E/AndroidRuntime(28816): at android.os.Looper.loop(Looper.java:130)
01-09 13:24:57.619: E/AndroidRuntime(28816): at android.app.ActivityThread.main(ActivityThread.java:3691)
01-09 13:24:57.619: E/AndroidRuntime(28816): at java.lang.reflect.Method.invokeNative(Native Method)
01-09 13:24:57.619: E/AndroidRuntime(28816): at java.lang.reflect.Method.invoke(Method.java:507)
01-09 13:24:57.619: E/AndroidRuntime(28816): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:907)
01-09 13:24:57.619: E/AndroidRuntime(28816): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:665)
01-09 13:24:57.619: E/AndroidRuntime(28816): at dalvik.system.NativeStart.main(Native Method)
01-09 13:24:57.619: E/AndroidRuntime(28816): Caused by: java.lang.ClassCastException: android.widget.TextView
01-09 13:24:57.619: E/AndroidRuntime(28816): at aid.assistant233.AidAssistant233Activity.onCreate(AidAssistant233Activity.java:331)
01-09 13:24:57.619: E/AndroidRuntime(28816): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
01-09 13:24:57.619: E/AndroidRuntime(28816): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1615)
01-09 13:24:57.619: E/AndroidRuntime(28816): ... 11 more
Where may be the problem?
Step1 : you can clean/build your project as everyone said . but If you are not getting your issue solve by clean/build then check my step2 for it.
Step:2:
I am not Sure But Can you please check your xml file once again?
this also could be happen if You've two elements with the same ID:
<TextView android:text="Hello Ahmedabad:"
android:id="#+id/txtahmedabad"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
</TextView>
<EditText android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:id="#+id/txtahmedabad"
android:text="">
</EditText>
if this is so then Give them different IDs -
it could picking the first one (the TextView) which obviously can't be cast to an EditText.
Hope it will some how help you.

Race condition with LoaderManager?

I'm using LoaderManager to load a cursor of list of contacts from my phone.
I'm literally using just the example code given here:
http://developer.android.com/reference/android/app/LoaderManager.html
My only change is that instead of using this as an adapter for a main screen listview, I've used it as an adapter for an AutoCompleteTextView. My problem is that when I quickly change the text, either by typing furiously, or holding down the delete button to delete everything in a row, it results in this error:
01-09 02:36:47.248: E/AndroidRuntime(24231): FATAL EXCEPTION: main
01-09 02:36:47.248: E/AndroidRuntime(24231): android.database.StaleDataException: Attempted to access a cursor after it has been closed.
01-09 02:36:47.248: E/AndroidRuntime(24231): at android.database.BulkCursorToCursorAdaptor.throwIfCursorIsClosed(BulkCursorToCursorAdaptor.java:64)
01-09 02:36:47.248: E/AndroidRuntime(24231): at android.database.BulkCursorToCursorAdaptor.getColumnNames(BulkCursorToCursorAdaptor.java:159)
01-09 02:36:47.248: E/AndroidRuntime(24231): at android.database.AbstractCursor.getColumnIndex(AbstractCursor.java:283)
01-09 02:36:47.248: E/AndroidRuntime(24231): at android.database.AbstractCursor.getColumnIndexOrThrow(AbstractCursor.java:308)
01-09 02:36:47.248: E/AndroidRuntime(24231): at android.database.CursorWrapper.getColumnIndexOrThrow(CursorWrapper.java:78)
01-09 02:36:47.248: E/AndroidRuntime(24231): at android.widget.CursorAdapter.swapCursor(CursorAdapter.java:338)
01-09 02:36:47.248: E/AndroidRuntime(24231): at android.widget.CursorAdapter.changeCursor(CursorAdapter.java:309)
01-09 02:36:47.248: E/AndroidRuntime(24231): at android.widget.CursorFilter.publishResults(CursorFilter.java:67)
01-09 02:36:47.248: E/AndroidRuntime(24231): at android.widget.Filter$ResultsHandler.handleMessage(Filter.java:282)
01-09 02:36:47.248: E/AndroidRuntime(24231): at android.os.Handler.dispatchMessage(Handler.java:99)
01-09 02:36:47.248: E/AndroidRuntime(24231): at android.os.Looper.loop(Looper.java:137)
01-09 02:36:47.248: E/AndroidRuntime(24231): at android.app.ActivityThread.main(ActivityThread.java:5070)
01-09 02:36:47.248: E/AndroidRuntime(24231): at java.lang.reflect.Method.invokeNative(Native Method)
01-09 02:36:47.248: E/AndroidRuntime(24231): at java.lang.reflect.Method.invoke(Method.java:511)
01-09 02:36:47.248: E/AndroidRuntime(24231): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:795)
01-09 02:36:47.248: E/AndroidRuntime(24231): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:558)
01-09 02:36:47.248: E/AndroidRuntime(24231): at dalvik.system.NativeStart.main(Native Method)
It seems that a CursorAdapter has a base implementation of getFilter(), which returns the current cursor after going through runQueryOnBackgroundThread(). This works fine for the original Android developer example for the LoaderManager, since ListViews don't use the filter at all. However, AutoCompleteTextViews do use the filter, so I was essentially running two async threads that were trying to load cursors, and was not thread-safe.
Since Filter already provides the same asynchronous loading functionality that LoaderManager does, I just did away with the LoaderManager and load through the Filter by overriding CursorAdapter.runQueryOnBackgroundThread().

Help with app, (force close)

I created an app, on eclips, but when i try to run it is force close why?
logcat :
03-16 19:28:09.820: INFO/ActivityManager(439): Start proc com.soundboard.Jaribarh.LIL_SIDDI for activity com.soundboard.Jaribarh.LIL_SIDDI/.Jaribarh_soundbord: pid=2621 uid=10020 gids={1015}
03-16 19:28:09.860: DEBUG/AK8973(415): Compass Start
03-16 19:28:09.860: DEBUG/Sensors(439): open_akm, fd=126
03-16 19:28:09.870: DEBUG/dalvikvm(2621): Debugger has detached; object registry had 1 entries
03-16 19:28:09.910: DEBUG/AndroidRuntime(2621): Shutting down VM
03-16 19:28:09.910: WARN/dalvikvm(2621): threadid=1: thread exiting with uncaught exception (group=0x40025a18)
03-16 19:28:09.910: ERROR/AndroidRuntime(2621): FATAL EXCEPTION: main
03-16 19:28:09.910: ERROR/AndroidRuntime(2621): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.soundboard.Jaribarh.LIL_SIDDI/com.soundboard.Jaribarh.LIL_SIDDI.Jaribarh_soundbord}: java.lang.ClassNotFoundException: com.soundboard.Jaribarh.LIL_SIDDI.Jaribarh_soundbord in loader dalvik.system.PathClassLoader[/data/app/com.soundboard.Jaribarh.LIL_SIDDI-2.apk]
03-16 19:28:09.910: ERROR/AndroidRuntime(2621): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2755)
03-16 19:28:09.910: ERROR/AndroidRuntime(2621): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2854)
03-16 19:28:09.910: ERROR/AndroidRuntime(2621): at android.app.ActivityThread.access$2300(ActivityThread.java:136)
03-16 19:28:09.910: ERROR/AndroidRuntime(2621): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2179)
03-16 19:28:09.910: ERROR/AndroidRuntime(2621): at android.os.Handler.dispatchMessage(Handler.java:99)
03-16 19:28:09.910: ERROR/AndroidRuntime(2621): at android.os.Looper.loop(Looper.java:143)
03-16 19:28:09.910: ERROR/AndroidRuntime(2621): at android.app.ActivityThread.main(ActivityThread.java:5068)
03-16 19:28:09.910: ERROR/AndroidRuntime(2621): at java.lang.reflect.Method.invokeNative(Native Method)
03-16 19:28:09.910: ERROR/AndroidRuntime(2621): at java.lang.reflect.Method.invoke(Method.java:521)
03-16 19:28:09.910: ERROR/AndroidRuntime(2621): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
03-16 19:28:09.910: ERROR/AndroidRuntime(2621): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
03-16 19:28:09.910: ERROR/AndroidRuntime(2621): at dalvik.system.NativeStart.main(Native Method)
03-16 19:28:09.910: ERROR/AndroidRuntime(2621): Caused by: java.lang.ClassNotFoundException: com.soundboard.Jaribarh.LIL_SIDDI.Jaribarh_soundbord in loader dalvik.system.PathClassLoader[/data/app/com.soundboard.Jaribarh.LIL_SIDDI-2.apk]
03-16 19:28:09.910: ERROR/AndroidRuntime(2621): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
03-16 19:28:09.910: ERROR/AndroidRuntime(2621): at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
03-16 19:28:09.910: ERROR/AndroidRuntime(2621): at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
03-16 19:28:09.910: ERROR/AndroidRuntime(2621): at android.app.Instrumentation.newActivity(Instrumentation.java:1034)
03-16 19:28:09.910: ERROR/AndroidRuntime(2621): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2747)
03-16 19:28:09.910: ERROR/AndroidRuntime(2621): ... 11 more
03-16 19:28:09.920: WARN/ActivityManager(439): Force finishing activity com.soundboard.Jaribarh.LIL_SIDDI/.Jaribarh_soundbord
03-16 19:28:10.420: WARN/ActivityManager(439): Activity pause timeout for HistoryRecord{48894070 com.soundboard.Jaribarh.LIL_SIDDI/.Jaribarh_soundbord}
It looks like the class com.soundboard.Jaribarh.LIL_SIDDI/.Jaribarh_soundbord doesn't exist. Possibly a misspelling of soundboard?
This is the important line from your log:
java.lang.ClassNotFoundException: com.soundboard.Jaribarh.LIL_SIDDI.Jaribarh_soundbord
Is there a typo in the class name, or is it possible that this Activity is not declared in the Manifest?

Categories

Resources