The "Highgui.imread" command does not work OpenCV Android - android

When I call Highgui.imread command, I get Unexpected Exception on my mobile phone.
I want to load an Image from SDCard to a MAT variable.
File imgFile = new File("/sdcard/image1.jpg");
if(imgFile.exists())
{
Mat pic1 = Highgui.imread(imgFile.getAbsolutePath());
}
I am using Galaxy Tab 10.1 + Android OS: 3.2 kernel ver: 2.6.36.3
The Error on Device:
"The application project1 (process prj.project) has stopped unexpectedly. Please try again."
Thank you for your help in advance.
Regards,
Ali
LogCat:
02-06 11:08:23.620: W/dalvikvm(5853): Exception Ljava/lang/UnsatisfiedLinkError; thrown while initializing Lorg/opencv/highgui/Highgui;
02-06 11:08:23.620: D/AndroidRuntime(5853): Shutting down VM
02-06 11:08:23.620: W/dalvikvm(5853): threadid=1: thread exiting with uncaught exception (group=0x400fc760)
02-06 11:08:23.620: E/AndroidRuntime(5853): FATAL EXCEPTION: main
02-06 11:08:23.620: E/AndroidRuntime(5853): java.lang.ExceptionInInitializerError
02-06 11:08:23.620: E/AndroidRuntime(5853): at photo.klu.PhotoKLUActivity$1.onClick(PhotoKLUActivity.java:89)
02-06 11:08:23.620: E/AndroidRuntime(5853): at android.view.View.performClick(View.java:3127)
02-06 11:08:23.620: E/AndroidRuntime(5853): at android.view.View$PerformClick.run(View.java:12025)
02-06 11:08:23.620: E/AndroidRuntime(5853): at android.os.Handler.handleCallback(Handler.java:587)
02-06 11:08:23.620: E/AndroidRuntime(5853): at android.os.Handler.dispatchMessage(Handler.java:92)
02-06 11:08:23.620: E/AndroidRuntime(5853): at android.os.Looper.loop(Looper.java:132)
02-06 11:08:23.620: E/AndroidRuntime(5853): at android.app.ActivityThread.main(ActivityThread.java:4126)
02-06 11:08:23.620: E/AndroidRuntime(5853): at java.lang.reflect.Method.invokeNative(Native Method)
02-06 11:08:23.620: E/AndroidRuntime(5853): at java.lang.reflect.Method.invoke(Method.java:491)
02-06 11:08:23.620: E/AndroidRuntime(5853): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:844)
02-06 11:08:23.620: E/AndroidRuntime(5853): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602)
02-06 11:08:23.620: E/AndroidRuntime(5853): at dalvik.system.NativeStart.main(Native Method)
02-06 11:08:23.620: E/AndroidRuntime(5853): Caused by: java.lang.UnsatisfiedLinkError: Couldn't load opencv_java: findLibrary returned null
02-06 11:08:23.620: E/AndroidRuntime(5853): at java.lang.Runtime.loadLibrary(Runtime.java:425)
02-06 11:08:23.620: E/AndroidRuntime(5853): at java.lang.System.loadLibrary(System.java:554)
02-06 11:08:23.620: E/AndroidRuntime(5853): at org.opencv.highgui.Highgui.<clinit>(Highgui.java:313)
02-06 11:08:23.620: E/AndroidRuntime(5853): ... 12 more
02-06 11:08:25.640: I/dalvikvm(5853): threadid=4: reacting to signal 3
02-06 11:08:25.640: I/dalvikvm(5853): Wrote stack traces to '/data/anr/traces.txt'

If you couldn't configurate opencv check this tutorial
http://opencv.org/platforms/android.html
If you call a method from openCv sdk for android firstly you've to implement;
private BaseLoaderCallback mOpenCVCallBack = new BaseLoaderCallback(this) {
#Override
public void onManagerConnected(int status) {
switch (status) {
case LoaderCallbackInterface.SUCCESS:
{
Log.i(TAG, "OpenCV loaded successfully");
// Create and set View
setContentView(R.layout.main);
} break;
default:
{
super.onManagerConnected(status);
} break;
}
}
};
and then call below in your method.
if (!OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_2_4_2, this, mOpenCVCallBack))
{
Log.e(TAG, "Cannot connect to OpenCV Manager");
}

The openCV library is not attached to your application.
Please do the following (i assume that the openCV library is imported to your workspace).
On Package Explorer > Right click on the application project > properties > under Library click Add > select openCV
Be sure that on Java Build Path you don't have anything related to openCV

Related

java.lang.NoClassDefFoundError when using intent to start new activity in jar

Main project which depends on a library named 'sf' i made.
In library 'sf',using Intent to start new activeity
import com.sf.proxy.MainActivity;
public void login(Activity context) {
Intent intent = new Intent(context,MainActivity.class);
context.startActivity(intent);
}
I got an exception saying:
02-06 10:07:58.198: D/AndroidRuntime(9770): Shutting down VM
02-06 10:07:58.198: W/dalvikvm(9770): threadid=1: thread exiting with uncaught exception (group=0xa6251288)
02-06 10:07:58.198: E/AndroidRuntime(9770): FATAL EXCEPTION: main
02-06 10:07:58.198: E/AndroidRuntime(9770): java.lang.IllegalStateException: Could not execute method of the activity
02-06 10:07:58.198: E/AndroidRuntime(9770): at android.view.View$1.onClick(View.java:3591)
02-06 10:07:58.198: E/AndroidRuntime(9770): at android.view.View.performClick(View.java:4084)
02-06 10:07:58.198: E/AndroidRuntime(9770): at android.view.View$PerformClick.run(View.java:16966)
02-06 10:07:58.198: E/AndroidRuntime(9770): at android.os.Handler.handleCallback(Handler.java:615)
02-06 10:07:58.198: E/AndroidRuntime(9770): at android.os.Handler.dispatchMessage(Handler.java:92)
02-06 10:07:58.198: E/AndroidRuntime(9770): at android.os.Looper.loop(Looper.java:137)
02-06 10:07:58.198: E/AndroidRuntime(9770): at android.app.ActivityThread.main(ActivityThread.java:4745)
02-06 10:07:58.198: E/AndroidRuntime(9770): at java.lang.reflect.Method.invokeNative(Native Method)
02-06 10:07:58.198: E/AndroidRuntime(9770): at java.lang.reflect.Method.invoke(Method.java:511)
02-06 10:07:58.198: E/AndroidRuntime(9770): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
02-06 10:07:58.198: E/AndroidRuntime(9770): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
02-06 10:07:58.198: E/AndroidRuntime(9770): at dalvik.system.NativeStart.main(Native Method)
02-06 10:07:58.198: E/AndroidRuntime(9770): Caused by: java.lang.reflect.InvocationTargetException
02-06 10:07:58.198: E/AndroidRuntime(9770): at java.lang.reflect.Method.invokeNative(Native Method)
02-06 10:07:58.198: E/AndroidRuntime(9770): at java.lang.reflect.Method.invoke(Method.java:511)
02-06 10:07:58.198: E/AndroidRuntime(9770): at android.view.View$1.onClick(View.java:3586)
02-06 10:07:58.198: E/AndroidRuntime(9770): ... 11 more
02-06 10:07:58.198: E/AndroidRuntime(9770): Caused by: java.lang.NoClassDefFoundError: com.sf.proxy.MainActivity
Manifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.sample">
<supports-screens
android:anyDensity="true"
android:largeScreens="true"
android:normalScreens="true" />
<application
android:label="#string/app_name"
android:theme="#style/AppTheme">
<activity
android:name="com.sf.proxy.MainActivity"
android:configChanges="orientation|screenSize|keyboardHidden"
android:screenOrientation="sensor"
android:theme="#android:style/Theme.Translucent.NoTitleBar">
</activity>
......
I know what this exception means so first I looked inside jar file, and the "missing" class with exactly exist.Anyone else experienced this? Thanks in advance.
You cannot package resources into jar files.
You can package pure java files that do not refer to any resources as jars.
In your case you need to reference the library project in your android project.
Library Projects
These projects contain shareable Android source code and resources that you can reference in Android projects. This is useful when you have common code that you want to reuse. Library projects cannot be installed onto a device, however, they are pulled into the .apk file at build time.
http://developer.android.com/tools/projects/index.html
To the question in the comment the closest resource could find
You cannot export a library project to a JAR file
A library cannot be distributed as a binary file (such as a JAR file). This will be added in a future version of the SDK Tools.
How to create jar for Android Library Project
Also, have a look into below url.
http://blog.sofisoftware.com/post/2011/10/05/Android-Library-projects-and-Jars
My sf jar depends on android-support-v4.jar. Main project depends on sf, Add android-support-v4.jar to Order and Export.
Solved.

java.lang.IllegalStateException: Could not execute method of the activity (using jdom libraries)

I'm writing an app and i need to parse some xml file so i decided to use the jdom libraries. In my android project i followed this step: Project>properties>java build path> libraries> add external jars and i select the jdom libraries.
Now i have this logcat output:
02-06 13:13:28.197: E/AndroidRuntime(7912): FATAL EXCEPTION: main
02-06 13:13:28.197: E/AndroidRuntime(7912): java.lang.IllegalStateException: Could not execute method of the activity
02-06 13:13:28.197: E/AndroidRuntime(7912): at android.view.View$1.onClick(View.java:3044)
02-06 13:13:28.197: E/AndroidRuntime(7912): at android.view.View.performClick(View.java:3511)
02-06 13:13:28.197: E/AndroidRuntime(7912): at android.view.View$PerformClick.run(View.java:14105)
02-06 13:13:28.197: E/AndroidRuntime(7912): at android.os.Handler.handleCallback(Handler.java:605)
02-06 13:13:28.197: E/AndroidRuntime(7912): at android.os.Handler.dispatchMessage(Handler.java:92)
02-06 13:13:28.197: E/AndroidRuntime(7912): at android.os.Looper.loop(Looper.java:137)
02-06 13:13:28.197: E/AndroidRuntime(7912): at android.app.ActivityThread.main(ActivityThread.java:4575)
02-06 13:13:28.197: E/AndroidRuntime(7912): at java.lang.reflect.Method.invokeNative(Native Method)
02-06 13:13:28.197: E/AndroidRuntime(7912): at java.lang.reflect.Method.invoke(Method.java:511)
02-06 13:13:28.197: E/AndroidRuntime(7912): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
02-06 13:13:28.197: E/AndroidRuntime(7912): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:556)
02-06 13:13:28.197: E/AndroidRuntime(7912): at dalvik.system.NativeStart.main(Native Method)
02-06 13:13:28.197: E/AndroidRuntime(7912): Caused by: java.lang.reflect.InvocationTargetException
02-06 13:13:28.197: E/AndroidRuntime(7912): at java.lang.reflect.Method.invokeNative(Native Method)
02-06 13:13:28.197: E/AndroidRuntime(7912): at java.lang.reflect.Method.invoke(Method.java:511)
02-06 13:13:28.197: E/AndroidRuntime(7912): at android.view.View$1.onClick(View.java:3039)
02-06 13:13:28.197: E/AndroidRuntime(7912): ... 11 more
02-06 13:13:28.197: E/AndroidRuntime(7912): Caused by: java.lang.NoClassDefFoundError: org.jdom2.input.SAXBuilder
02-06 13:13:28.197: E/AndroidRuntime(7912): at com.tesi.AR.Anteprima.save(Anteprima.java:53)
02-06 13:13:28.197: E/AndroidRuntime(7912): ... 14 more
when the app execute this line of code:
//Creazione documento xml
SAXBuilder builder = new SAXBuilder();
Document document = builder.build(confFile);
Element rootElement = document.getRootElement();
Element ar = new Element("AR");
rootElement.addContent(ar);
Element target = new Element ("TARGET");
target.setText(targetPathFile.getAbsolutePath());
ar.addContent(target);
Element contenuto = new Element("CONTENUTO");
contenuto.setText(contenutiPathFile.getAbsolutePath());
ar.addContent(contenuto);
Element scalatura = new Element("SCALATURA");
scalatura.setText(String.valueOf(scale));
ar.addContent(scalatura);
//scrittura sul file xml
XMLOutputter outputter = new XMLOutputter();
outputter.output(document, new FileOutputStream(confFile));
thanks for your attention.
Have you followed the instructions here: Including JDOM in your project
Specifically, did you put the JDOM jar in your libs/ folder in your project?
I solve it in Project>properties>java build path>order and export ticking the libraries

Unable to use JaudioTagger on Android - NoClassDefFoundError with Jaudio

In my project properties , I added Jaudiotagger.jar as an external archive. Eclipse detects the classes it has.
Here is my sample code :
protected void onListItemClick(ListView l, View v, int position, long id) {
Cursor cl = ((SimpleCursorAdapter)l.getAdapter()).getCursor();
cl.moveToPosition(position);
String loc = cl.getString(cl.getColumnIndex(MediaStore.MediaColumns.DATA));
try {
AudioFile f = AudioFileIO.read(new File(loc));
Tag tag = f.getTag();
AudioHeader h = f.getAudioHeader();
Toast.makeText(this, tag.getFirst(FieldKey.ALBUM), Toast.LENGTH_SHORT).show();
}
catch (Exception e){}
When I click on any list item (which is actually an audio file) , the app crashes. Here is the logcat log :
02-06 18:19:52.039: W/dalvikvm(32310): threadid=1: thread exiting with uncaught exception (group=0x40c751f8)
02-06 18:19:52.049: E/AndroidRuntime(32310): FATAL EXCEPTION: main
02-06 18:19:52.049: E/AndroidRuntime(32310): java.lang.NoClassDefFoundError: org.jaudiotagger.audio.AudioFileIO
02-06 18:19:52.049: E/AndroidRuntime(32310): at com.niteesh.album.art.MainActivity.onListItemClick(MainActivity.java:51)
02-06 18:19:52.049: E/AndroidRuntime(32310): at android.app.ListActivity$2.onItemClick(ListActivity.java:319)
02-06 18:19:52.049: E/AndroidRuntime(32310): at android.widget.AdapterView.performItemClick(AdapterView.java:292)
02-06 18:19:52.049: E/AndroidRuntime(32310): at android.widget.AbsListView.performItemClick(AbsListView.java:1181)
02-06 18:19:52.049: E/AndroidRuntime(32310): at android.widget.AbsListView$PerformClick.run(AbsListView.java:2709)
02-06 18:19:52.049: E/AndroidRuntime(32310): at android.widget.AbsListView$1.run(AbsListView.java:3464)
02-06 18:19:52.049: E/AndroidRuntime(32310): at android.os.Handler.handleCallback(Handler.java:605)
02-06 18:19:52.049: E/AndroidRuntime(32310): at android.os.Handler.dispatchMessage(Handler.java:92)
02-06 18:19:52.049: E/AndroidRuntime(32310): at android.os.Looper.loop(Looper.java:137)
02-06 18:19:52.049: E/AndroidRuntime(32310): at android.app.ActivityThread.main(ActivityThread.java:4511)
02-06 18:19:52.049: E/AndroidRuntime(32310): at java.lang.reflect.Method.invokeNative(Native Method)
02-06 18:19:52.049: E/AndroidRuntime(32310): at java.lang.reflect.Method.invoke(Method.java:511)
02-06 18:19:52.049: E/AndroidRuntime(32310): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:980)
02-06 18:19:52.049: E/AndroidRuntime(32310): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:747)
02-06 18:19:52.049: E/AndroidRuntime(32310): at dalvik.system.NativeStart.main(Native Method)
I also added TagOptionSingleton.getInstance().setAndroid(true); as mentioned in another thread here at SO. And when I click on item then , it says
java.lang.NoClassDefFoundError: org.jaudiotagger.tag.TagOptionSingleton;
Can someone help where am I going wrong ?
What you did allows the code in Eclipse to compile but doesn't add the jar file to the APK. You need to create a directory in the project root called "libs" and add the jar file to that. Hope that works for you.
Android does not support Java sound API, even you add it into your project manually, you may meet with a problem of namespace.

Android Map Application : i cant run

02-06 14:08:29.678: W/dalvikvm(702): threadid=1: thread exiting with uncaught exception (group=0x409c01f8)
02-06 14:08:29.718: E/AndroidRuntime(702): FATAL EXCEPTION: main
02-06 14:08:29.718: E/AndroidRuntime(702): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{nhexia.pack/nhexia.pack.SaturnVTDActivity}: java.lang.ClassNotFoundException: nhexia.pack.SaturnVTDActivity
02-06 14:08:29.718: E/AndroidRuntime(702): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1880)
02-06 14:08:29.718: E/AndroidRuntime(702): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
02-06 14:08:29.718: E/AndroidRuntime(702): at android.app.ActivityThread.access$600(ActivityThread.java:123)
02-06 14:08:29.718: E/AndroidRuntime(702): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
02-06 14:08:29.718: E/AndroidRuntime(702): at android.os.Handler.dispatchMessage(Handler.java:99)
02-06 14:08:29.718: E/AndroidRuntime(702): at android.os.Looper.loop(Looper.java:137)
02-06 14:08:29.718: E/AndroidRuntime(702): at android.app.ActivityThread.main(ActivityThread.java:4424)
02-06 14:08:29.718: E/AndroidRuntime(702): at java.lang.reflect.Method.invokeNative(Native Method)
02-06 14:08:29.718: E/AndroidRuntime(702): at java.lang.reflect.Method.invoke(Method.java:511)
02-06 14:08:29.718: E/AndroidRuntime(702): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
02-06 14:08:29.718: E/AndroidRuntime(702): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
02-06 14:08:29.718: E/AndroidRuntime(702): at dalvik.system.NativeStart.main(Native Method)
02-06 14:08:29.718: E/AndroidRuntime(702): Caused by: java.lang.ClassNotFoundException: nhexia.pack.SaturnVTDActivity
02-06 14:08:29.718: E/AndroidRuntime(702): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
02-06 14:08:29.718: E/AndroidRuntime(702): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
02-06 14:08:29.718: E/AndroidRuntime(702): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
02-06 14:08:29.718: E/AndroidRuntime(702): at android.app.Instrumentation.newActivity(Instrumentation.java:1023)
02-06 14:08:29.718: E/AndroidRuntime(702): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1871)
02-06 14:08:29.718: E/AndroidRuntime(702): ... 11 more
i got this error when im run my application.... help
Check your manifest file to make sure that the activity nhexia.pack.SaturnVTDActivity is declared correctly.
Its also possible that you updated the ADT plugin and need to move your includes around as this link suggests.
It seems that you try to launch a class which cannot be found. Is the activity defined in the manifest, is the class misspelled?
Try debug in eclipse and see what line it fails on, and share that in here.

Issues with loading Spinner in Android

I was working on loading a combobox or in android terms a spinner. I was following this tutorial and I can't seem to get it working with my current app.
http://developer.android.com/guide/tutorials/views/hello-spinner.html
I first created an app that just loaded a spinner. It ran completely fine but when I tried adding it to my current code it crashes everytime. I have the combo box in a second "activity" or "page" so when the user clicks next page the user gets directed to the next page but the force close comes up before anything happens.
When I commented out the line s.setAdapter(adapter) and the program works without crashing(but obviously the spinner is not loaded). I was hoping my logcat would reveal some information on this but it doesnt seem to display anything.
The only difference I can see in my code is that it is file being called.
Any suggestions are greatly appreciated.
Thanks!
Edit:
Here is the LogCat
02-06 19:39:08.289: ERROR/SensorManager(2260): registerListener 4:gp2a Light Sensor delay:240
02-06 19:39:08.294: ERROR/SensorManager(2260): =======>>>Sensor Thread RUNNING <<<========
02-06 19:39:08.294: ERROR/SensorManager(2260): registerListener: com.android.server.PowerManagerService$9#477ecd90
02-06 19:39:08.504: ERROR/SensorManager(2260): registerListener 0:SMB380 delay:240
02-06 19:39:08.534: ERROR/SensorManager(2260): registerListener: android.view.WindowOrientationListener$SensorEventListenerImpl#47960660
02-06 19:39:08.544: ERROR/PowerManagerService(2260): setTargetLocked targetValue=116 target=116 nominalCurrentValue=11 ani=true
02-06 19:39:12.859: ERROR/AndroidRuntime(11972): Uncaught handler: thread main exiting due to uncaught exception
02-06 19:39:12.869: ERROR/AndroidRuntime(11972): java.lang.RuntimeException: Unable to start activity ComponentInfo{Jason.notify/Jason.notify.Screen2}: java.lang.NullPointerException
02-06 19:39:12.869: ERROR/AndroidRuntime(11972): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2496)
02-06 19:39:12.869: ERROR/AndroidRuntime(11972): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)
02-06 19:39:12.869: ERROR/AndroidRuntime(11972): at android.app.ActivityThread.access$2200(ActivityThread.java:119)
02-06 19:39:12.869: ERROR/AndroidRuntime(11972): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)
02-06 19:39:12.869: ERROR/AndroidRuntime(11972): at android.os.Handler.dispatchMessage(Handler.java:99)
02-06 19:39:12.869: ERROR/AndroidRuntime(11972): at android.os.Looper.loop(Looper.java:123)
02-06 19:39:12.869: ERROR/AndroidRuntime(11972): at android.app.ActivityThread.main(ActivityThread.java:4363)
02-06 19:39:12.869: ERROR/AndroidRuntime(11972): at java.lang.reflect.Method.invokeNative(Native Method)
02-06 19:39:12.869: ERROR/AndroidRuntime(11972): at java.lang.reflect.Method.invoke(Method.java:521)
02-06 19:39:12.869: ERROR/AndroidRuntime(11972): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:862)
02-06 19:39:12.869: ERROR/AndroidRuntime(11972): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620)
02-06 19:39:12.869: ERROR/AndroidRuntime(11972): at dalvik.system.NativeStart.main(Native Method)
02-06 19:39:12.869: ERROR/AndroidRuntime(11972): Caused by: java.lang.NullPointerException
02-06 19:39:12.869: ERROR/AndroidRuntime(11972): at Jason.notify.Screen2.onCreate(Screen2.java:37)
02-06 19:39:12.869: ERROR/AndroidRuntime(11972): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
02-06 19:39:12.869: ERROR/AndroidRuntime(11972): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)
02-06 19:39:12.869: ERROR/AndroidRuntime(11972): ... 11 more
02-06 19:39:39.359: ERROR/InfoAlarmWidget(2332): AllDay Event Count = 0
02-06 19:39:40.884: ERROR/SensorManager(2260): unregisterListener: com.android.server.PowerManagerService$9#477ecd90
02-06 19:39:41.359: ERROR/SensorManager(2260): unregisterListener: android.view.WindowOrientationListener$SensorEventListenerImpl#47960660
02-06 19:54:44.729: ERROR/NetworkStateTracker(2260): net.tcp.buffersize.hsdpa not found in system properties. Using defaults
You have a null pointer on your onCreate method.
Judging from the line you say you comment and it works, I would assume your s reference is null.
How do you assign it? You should be using a findViewById() call if you inflate your layout via xml (as is the Android way)

Categories

Resources