I have got the Exception on AndroidRunTimeException. . .
It says that the You can not combine Custom titles With other title features.
Can anybudy says why it is occurs ??
My Exceptions in as below :
04-26 15:26:12.461: ERROR/BluetoothChat(455): +++ ON CREATE +++
04-26 15:26:12.616: ERROR/AndroidRuntime(455): Uncaught handler: thread main exiting due to uncaught exception
04-26 15:26:12.701: ERROR/AndroidRuntime(455): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.menu/com.menu.volunteer_management.BluetoothChatApp}: android.util.AndroidRuntimeException: You cannot combine custom titles with other title features
04-26 15:26:12.701: ERROR/AndroidRuntime(455): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2496)
04-26 15:26:12.701: ERROR/AndroidRuntime(455): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)
04-26 15:26:12.701: ERROR/AndroidRuntime(455): at android.app.ActivityThread.access$2200(ActivityThread.java:119)
04-26 15:26:12.701: ERROR/AndroidRuntime(455): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)
04-26 15:26:12.701: ERROR/AndroidRuntime(455): at android.os.Handler.dispatchMessage(Handler.java:99)
04-26 15:26:12.701: ERROR/AndroidRuntime(455): at android.os.Looper.loop(Looper.java:123)
04-26 15:26:12.701: ERROR/AndroidRuntime(455): at android.app.ActivityThread.main(ActivityThread.java:4363)
04-26 15:26:12.701: ERROR/AndroidRuntime(455): at java.lang.reflect.Method.invokeNative(Native Method)
04-26 15:26:12.701: ERROR/AndroidRuntime(455): at java.lang.reflect.Method.invoke(Method.java:521)
04-26 15:26:12.701: ERROR/AndroidRuntime(455): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
04-26 15:26:12.701: ERROR/AndroidRuntime(455): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
04-26 15:26:12.701: ERROR/AndroidRuntime(455): at dalvik.system.NativeStart.main(Native Method)
04-26 15:26:12.701: ERROR/AndroidRuntime(455): Caused by: android.util.AndroidRuntimeException: You cannot combine custom titles with other title features
04-26 15:26:12.701: ERROR/AndroidRuntime(455): at com.android.internal.policy.impl.PhoneWindow.requestFeature(PhoneWindow.java:183)
04-26 15:26:12.701: ERROR/AndroidRuntime(455): at com.android.internal.policy.impl.PhoneWindow.generateLayout(PhoneWindow.java:2057)
04-26 15:26:12.701: ERROR/AndroidRuntime(455): at com.android.internal.policy.impl.PhoneWindow.installDecor(PhoneWindow.java:2207)
04-26 15:26:12.701: ERROR/AndroidRuntime(455): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:194)
04-26 15:26:12.701: ERROR/AndroidRuntime(455): at android.app.Activity.setContentView(Activity.java:1622)
04-26 15:26:12.701: ERROR/AndroidRuntime(455): at com.menu.volunteer_management.BluetoothChatApp.onCreate(BluetoothChatApp.java:74)
04-26 15:26:12.701: ERROR/AndroidRuntime(455): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
04-26 15:26:12.701: ERROR/AndroidRuntime(455): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)
04-26 15:26:12.701: ERROR/AndroidRuntime(455): ... 11 more
Thank You..
In android 4.0 and later you can not add your custom title in this way get help from this document.
http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/app/CustomTitle.html
Related
recently while reading some tutorials online, I saw this video suggesting that the Android SDK now supports OpenGL ES 2.0:
http://www.youtube.com/watch?feature=player_embedded&v=T--vFtyZvc4
Enthusiastically, I added the option for 'GPU Emulation' in my emulator and tried to run a basic HelloOpenGLES20 app, however I was greeted with this error, and some null pointer exceptions which doesn't make sense:
Sorry!
The application
LessonOneActivity (process
lesson.One has stopped
unexpectedly. Please try again.
Force close
The app runs fine on a real Android phone displaying some spinning triangles, I'm wondering if anyone has encountered the problem I'm facing, I've did a fair share of googling but could find no solutions =(
Here's the log:
04-26 06:42:08.782: D/AndroidRuntime(577): Shutting down VM
04-26 06:42:08.813: W/dalvikvm(577): threadid=1: thread exiting with uncaught exception (group=0x40015560)
04-26 06:42:08.842: E/AndroidRuntime(577): FATAL EXCEPTION: main
04-26 06:42:08.842: E/AndroidRuntime(577): java.lang.RuntimeException: Unable to resume activity {lesson.One/com.learnopengles.android.lesson1.LessonOneActivity}: java.lang.NullPointerException
04-26 06:42:08.842: E/AndroidRuntime(577): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2120)
04-26 06:42:08.842: E/AndroidRuntime(577): at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2135)
04-26 06:42:08.842: E/AndroidRuntime(577): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1668)
04-26 06:42:08.842: E/AndroidRuntime(577): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
04-26 06:42:08.842: E/AndroidRuntime(577): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
04-26 06:42:08.842: E/AndroidRuntime(577): at android.os.Handler.dispatchMessage(Handler.java:99)
04-26 06:42:08.842: E/AndroidRuntime(577): at android.os.Looper.loop(Looper.java:130)
04-26 06:42:08.842: E/AndroidRuntime(577): at android.app.ActivityThread.main(ActivityThread.java:3683)
04-26 06:42:08.842: E/AndroidRuntime(577): at java.lang.reflect.Method.invokeNative(Native Method)
04-26 06:42:08.842: E/AndroidRuntime(577): at java.lang.reflect.Method.invoke(Method.java:507)
04-26 06:42:08.842: E/AndroidRuntime(577): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
04-26 06:42:08.842: E/AndroidRuntime(577): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
04-26 06:42:08.842: E/AndroidRuntime(577): at dalvik.system.NativeStart.main(Native Method)
04-26 06:42:08.842: E/AndroidRuntime(577): Caused by: java.lang.NullPointerException
04-26 06:42:08.842: E/AndroidRuntime(577): at android.opengl.GLSurfaceView.onResume(GLSurfaceView.java:512)
04-26 06:42:08.842: E/AndroidRuntime(577): at com.learnopengles.android.lesson1.LessonOneActivity.onResume(LessonOneActivity.java:46)
04-26 06:42:08.842: E/AndroidRuntime(577): at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1150)
04-26 06:42:08.842: E/AndroidRuntime(577): at android.app.Activity.performResume(Activity.java:3832)
04-26 06:42:08.842: E/AndroidRuntime(577): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2110)
04-26 06:42:08.842: E/AndroidRuntime(577): ... 12 more
04-26 06:42:13.292: I/Process(577): Sending signal. PID: 577 SIG: 9
I have run the code, and the exception is due to the fact that the emulator still does not support GLES20. If you print more information, you'll see that supportsEs2 is false.
Why the emulator does not support GLES20 even if GPU Emulation is set to true is system-dependent. If you are developing on Linux, it may be related to the graphics card. Here is a similar question with some possible solutions. At least you can try it.
EDIT:
According to the official site, you need to set your emulator target to API 15 (rev03) or higher.
When I'm creating object to write to output stream (size is lower than 150KB) it probably gets instantly destroyed, because of:
System.out.println("Sending object..");
Packet p = new Packet(mJpegData); // here exists
System.out.println(p); // reference exists
oos.writeObject(p); // null exception error
full error:
04-26 21:37:01.414: W/System.err(12888): java.lang.NullPointerException
04-26 21:37:01.414: W/System.err(12888): at pl.aadamczyk.webcamera.Preview$PreCallback.onPreviewFrame(Preview.java:148)
04-26 21:37:01.417: W/System.err(12888): at android.hardware.Camera$EventHandler.handleMessage(Camera.java:583)
04-26 21:37:01.417: W/System.err(12888): at android.os.Handler.dispatchMessage(Handler.java:99)
04-26 21:37:01.417: W/System.err(12888): at android.os.Looper.loop(Looper.java:130)
04-26 21:37:01.417: W/System.err(12888): at android.app.ActivityThread.main(ActivityThread.java:3687)
04-26 21:37:01.417: W/System.err(12888): at java.lang.reflect.Method.invokeNative(Native Method)
04-26 21:37:01.417: W/System.err(12888): at java.lang.reflect.Method.invoke(Method.java:507)
04-26 21:37:01.417: W/System.err(12888): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:842)
04-26 21:37:01.417: W/System.err(12888): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
04-26 21:37:01.417: W/System.err(12888): at dalvik.system.NativeStart.main(Native Method)
04-26 21:37:01.472: D/dalvikvm(12888): GC_FOR_MALLOC freed 1152K, 57% free 2820K/6535K, external 1596K/2108K, paused 17ms
04-26 21:37:01.472: I/System.out(12888): My Object has been GC'd. Packet#4063d908
04-26 21:37:01.523: D/dalvikvm(12888): GC_CONCURRENT freed 28K, 50% free 3311K/6535K, external 1596K/2108K, paused 3ms+10ms
"My Object has been GC'd. " is printed by Packet's finalizer.
whole code: http://pastebin.com/zc5TcSgY
Why GS is removing my object? I've got in about 120 MB free memory.
How to fix it?
I think the problem is with oos because it might be the one causing NullPointerException.
Change your code a little as below:
System.out.println("Sending object..");
Packet p = new Packet(mJpegData); // here exists
System.out.println(p); // reference exists
if(oos != null)
oos.writeObject(p);
else
Log.w("oos", "its null");
When I try to run my app on an emulator, my app comes up with an error message saying
The app has stopped unexpectedly. Please try again."
How do I fix this?
Here is my code:
Manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.DOLEnterprises.GTA5Guide"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="4" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<activity
android:name= "com.google.ads.AdActivity"
android:configChanges= "keyboard|keyboardHidden|orientation"
></activity>
<activity
android:name=".GTA5GuideActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
The "Appname"Activity.java:
package com.DOLEnterprises.GTA5Guide;
import android.app.Activity;
import android.os.Bundle;
public class GTA5GuideActivity extends Activity {
/** Called when the activity is first created. */
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
}
Main.xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads= "http://schemas.android.com/apk/lib/com.google.ads"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<ImageView
android:id="#+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:scaleType="center"
android:src="#drawable/gtaapp" />
<com.google.ads.AdView android:id= "#+id/ad"
android:layout_width="wrap_content"
android:layout_height= "wrap_content"
ads:adUnitId= "soon"
ads:loadAdOnCreate= "a14f8315a6c11bf"
ads:adSize="BANNER"
/>
</LinearLayout>
The Logcat thing:
04-10 08:23:55.424: D/dalvikvm(224): GC freed 510 objects / 46816 bytes in 75ms
04-10 08:23:55.534: D/AndroidRuntime(224): Shutting down VM
04-10 08:23:55.534: W/dalvikvm(224): threadid=3: thread exiting with uncaught exception (group=0x4001b188)
04-10 08:23:55.534: E/AndroidRuntime(224): Uncaught handler: thread main exiting due to uncaught exception
04-10 08:23:55.554: E/AndroidRuntime(224): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.DOLEnterprises.GTA5Guide/com.DOLEnterprises.GTA5Guide.GTA5GuideActivity}: android.view.InflateException: Binary XML file line #16: Error inflating class com.google.ads.AdView
04-10 08:23:55.554: E/AndroidRuntime(224): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2496)
04-10 08:23:55.554: E/AndroidRuntime(224): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)
04-10 08:23:55.554: E/AndroidRuntime(224): at android.app.ActivityThread.access$2200(ActivityThread.java:119)
04-10 08:23:55.554: E/AndroidRuntime(224): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)
04-10 08:23:55.554: E/AndroidRuntime(224): at android.os.Handler.dispatchMessage(Handler.java:99)
04-10 08:23:55.554: E/AndroidRuntime(224): at android.os.Looper.loop(Looper.java:123)
04-10 08:23:55.554: E/AndroidRuntime(224): at android.app.ActivityThread.main(ActivityThread.java:4363)
04-10 08:23:55.554: E/AndroidRuntime(224): at java.lang.reflect.Method.invokeNative(Native Method)
04-10 08:23:55.554: E/AndroidRuntime(224): at java.lang.reflect.Method.invoke(Method.java:521)
04-10 08:23:55.554: E/AndroidRuntime(224): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
04-10 08:23:55.554: E/AndroidRuntime(224): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
04-10 08:23:55.554: E/AndroidRuntime(224): at dalvik.system.NativeStart.main(Native Method)
04-10 08:23:55.554: E/AndroidRuntime(224): Caused by: android.view.InflateException: Binary XML file line #16: Error inflating class com.google.ads.AdView
04-10 08:23:55.554: E/AndroidRuntime(224): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:576)
04-10 08:23:55.554: E/AndroidRuntime(224): at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)
04-10 08:23:55.554: E/AndroidRuntime(224): at android.view.LayoutInflater.inflate(LayoutInflater.java:407)
04-10 08:23:55.554: E/AndroidRuntime(224): at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
04-10 08:23:55.554: E/AndroidRuntime(224): at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
04-10 08:23:55.554: E/AndroidRuntime(224): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:198)
04-10 08:23:55.554: E/AndroidRuntime(224): at android.app.Activity.setContentView(Activity.java:1622)
04-10 08:23:55.554: E/AndroidRuntime(224): at com.DOLEnterprises.GTA5Guide.GTA5GuideActivity.onCreate(GTA5GuideActivity.java:11)
04-10 08:23:55.554: E/AndroidRuntime(224): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
04-10 08:23:55.554: E/AndroidRuntime(224): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)
04-10 08:23:55.554: E/AndroidRuntime(224): ... 11 more
04-10 08:23:55.554: E/AndroidRuntime(224): Caused by: java.lang.ClassNotFoundException: com.google.ads.AdView in loader dalvik.system.PathClassLoader#44e8ca48
04-10 08:23:55.554: E/AndroidRuntime(224): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
04-10 08:23:55.554: E/AndroidRuntime(224): at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
04-10 08:23:55.554: E/AndroidRuntime(224): at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
04-10 08:23:55.554: E/AndroidRuntime(224): at android.view.LayoutInflater.createView(LayoutInflater.java:466)
04-10 08:23:55.554: E/AndroidRuntime(224): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:565)
04-10 08:23:55.554: E/AndroidRuntime(224): ... 20 more
04-10 08:23:55.584: I/dalvikvm(224): threadid=7: reacting to signal 3
04-10 08:23:55.584: E/dalvikvm(224): Unable to open stack trace file '/data/anr/traces.txt': Permission denied
04-10 08:24:22.804: D/dalvikvm(231): GC freed 537 objects / 47832 bytes in 68ms
04-10 08:24:22.913: D/AndroidRuntime(231): Shutting down VM
04-10 08:24:22.913: W/dalvikvm(231): threadid=3: thread exiting with uncaught exception (group=0x4001b188)
04-10 08:24:22.913: E/AndroidRuntime(231): Uncaught handler: thread main exiting due to uncaught exception
04-10 08:24:22.933: E/AndroidRuntime(231): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.DOLEnterprises.GTA5Guide/com.DOLEnterprises.GTA5Guide.GTA5GuideActivity}: android.view.InflateException: Binary XML file line #16: Error inflating class com.google.ads.AdView
04-10 08:24:22.933: E/AndroidRuntime(231): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2496)
04-10 08:24:22.933: E/AndroidRuntime(231): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)
04-10 08:24:22.933: E/AndroidRuntime(231): at android.app.ActivityThread.access$2200(ActivityThread.java:119)
04-10 08:24:22.933: E/AndroidRuntime(231): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)
04-10 08:24:22.933: E/AndroidRuntime(231): at android.os.Handler.dispatchMessage(Handler.java:99)
04-10 08:24:22.933: E/AndroidRuntime(231): at android.os.Looper.loop(Looper.java:123)
04-10 08:24:22.933: E/AndroidRuntime(231): at android.app.ActivityThread.main(ActivityThread.java:4363)
04-10 08:24:22.933: E/AndroidRuntime(231): at java.lang.reflect.Method.invokeNative(Native Method)
04-10 08:24:22.933: E/AndroidRuntime(231): at java.lang.reflect.Method.invoke(Method.java:521)
04-10 08:24:22.933: E/AndroidRuntime(231): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
04-10 08:24:22.933: E/AndroidRuntime(231): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
04-10 08:24:22.933: E/AndroidRuntime(231): at dalvik.system.NativeStart.main(Native Method)
04-10 08:24:22.933: E/AndroidRuntime(231): Caused by: android.view.InflateException: Binary XML file line #16: Error inflating class com.google.ads.AdView
04-10 08:24:22.933: E/AndroidRuntime(231): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:576)
04-10 08:24:22.933: E/AndroidRuntime(231): at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)
04-10 08:24:22.933: E/AndroidRuntime(231): at android.view.LayoutInflater.inflate(LayoutInflater.java:407)
04-10 08:24:22.933: E/AndroidRuntime(231): at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
04-10 08:24:22.933: E/AndroidRuntime(231): at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
04-10 08:24:22.933: E/AndroidRuntime(231): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:198)
04-10 08:24:22.933: E/AndroidRuntime(231): at android.app.Activity.setContentView(Activity.java:1622)
04-10 08:24:22.933: E/AndroidRuntime(231): at com.DOLEnterprises.GTA5Guide.GTA5GuideActivity.onCreate(GTA5GuideActivity.java:11)
04-10 08:24:22.933: E/AndroidRuntime(231): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
04-10 08:24:22.933: E/AndroidRuntime(231): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)
04-10 08:24:22.933: E/AndroidRuntime(231): ... 11 more
04-10 08:24:22.933: E/AndroidRuntime(231): Caused by: java.lang.ClassNotFoundException: com.google.ads.AdView in loader dalvik.system.PathClassLoader#44e8ca28
04-10 08:24:22.933: E/AndroidRuntime(231): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
04-10 08:24:22.933: E/AndroidRuntime(231): at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
04-10 08:24:22.933: E/AndroidRuntime(231): at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
04-10 08:24:22.933: E/AndroidRuntime(231): at android.view.LayoutInflater.createView(LayoutInflater.java:466)
04-10 08:24:22.933: E/AndroidRuntime(231): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:565)
04-10 08:24:22.933: E/AndroidRuntime(231): ... 20 more
04-10 08:24:22.953: I/dalvikvm(231): threadid=7: reacting to signal 3
04-10 08:24:22.953: E/dalvikvm(231): Unable to open stack trace file '/data/anr/traces.txt': Permission denied
04-10 08:24:31.884: D/dalvikvm(237): GC freed 564 objects / 48880 bytes in 92ms
04-10 08:24:31.993: D/AndroidRuntime(237): Shutting down VM
04-10 08:24:31.993: W/dalvikvm(237): threadid=3: thread exiting with uncaught exception (group=0x4001b188)
04-10 08:24:32.003: E/AndroidRuntime(237): Uncaught handler: thread main exiting due to uncaught exception
04-10 08:24:32.023: E/AndroidRuntime(237): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.DOLEnterprises.GTA5Guide/com.DOLEnterprises.GTA5Guide.GTA5GuideActivity}: android.view.InflateException: Binary XML file line #16: Error inflating class com.google.ads.AdView
04-10 08:24:32.023: E/AndroidRuntime(237): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2496)
04-10 08:24:32.023: E/AndroidRuntime(237): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)
04-10 08:24:32.023: E/AndroidRuntime(237): at android.app.ActivityThread.access$2200(ActivityThread.java:119)
04-10 08:24:32.023: E/AndroidRuntime(237): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)
04-10 08:24:32.023: E/AndroidRuntime(237): at android.os.Handler.dispatchMessage(Handler.java:99)
04-10 08:24:32.023: E/AndroidRuntime(237): at android.os.Looper.loop(Looper.java:123)
04-10 08:24:32.023: E/AndroidRuntime(237): at android.app.ActivityThread.main(ActivityThread.java:4363)
04-10 08:24:32.023: E/AndroidRuntime(237): at java.lang.reflect.Method.invokeNative(Native Method)
04-10 08:24:32.023: E/AndroidRuntime(237): at java.lang.reflect.Method.invoke(Method.java:521)
04-10 08:24:32.023: E/AndroidRuntime(237): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
04-10 08:24:32.023: E/AndroidRuntime(237): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
04-10 08:24:32.023: E/AndroidRuntime(237): at dalvik.system.NativeStart.main(Native Method)
04-10 08:24:32.023: E/AndroidRuntime(237): Caused by: android.view.InflateException: Binary XML file line #16: Error inflating class com.google.ads.AdView
04-10 08:24:32.023: E/AndroidRuntime(237): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:576)
04-10 08:24:32.023: E/AndroidRuntime(237): at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)
04-10 08:24:32.023: E/AndroidRuntime(237): at android.view.LayoutInflater.inflate(LayoutInflater.java:407)
04-10 08:24:32.023: E/AndroidRuntime(237): at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
04-10 08:24:32.023: E/AndroidRuntime(237): at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
04-10 08:24:32.023: E/AndroidRuntime(237): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:198)
04-10 08:24:32.023: E/AndroidRuntime(237): at android.app.Activity.setContentView(Activity.java:1622)
04-10 08:24:32.023: E/AndroidRuntime(237): at com.DOLEnterprises.GTA5Guide.GTA5GuideActivity.onCreate(GTA5GuideActivity.java:11)
04-10 08:24:32.023: E/AndroidRuntime(237): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
04-10 08:24:32.023: E/AndroidRuntime(237): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)
04-10 08:24:32.023: E/AndroidRuntime(237): ... 11 more
04-10 08:24:32.023: E/AndroidRuntime(237): Caused by: java.lang.ClassNotFoundException: com.google.ads.AdView in loader dalvik.system.PathClassLoader#44e8ca28
04-10 08:24:32.023: E/AndroidRuntime(237): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
04-10 08:24:32.023: E/AndroidRuntime(237): at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
04-10 08:24:32.023: E/AndroidRuntime(237): at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
04-10 08:24:32.023: E/AndroidRuntime(237): at android.view.LayoutInflater.createView(LayoutInflater.java:466)
04-10 08:24:32.023: E/AndroidRuntime(237): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:565)
04-10 08:24:32.023: E/AndroidRuntime(237): ... 20 more
04-10 08:24:32.043: I/dalvikvm(237): threadid=7: reacting to signal 3
04-10 08:24:32.043: E/dalvikvm(237): Unable to open stack trace file '/data/anr/traces.txt': Permission denied
---EDIT---
Are you sure you have downloaded the "Ad" library and included it in your project? Class not found suggests that you have not successfully linked it to your project. Also try rebuilding your project by following the steps below .
Try cleaning your project... Project > Clean > Choose your Project > Ok
Rerun your project.
it seems that error is caused due to Typos or casting ...... Check carefully for Typos and casting ....... check for library folder name ....
check out this
android:configChanges requieres all parameters to show ads in application
change the SDK version to 14 of your Application
mention it in your AndroidManifest.xml file
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="14"/>
<activity android:name="com.google.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
I have developed project in android3.1 and i am trying to run in android2.1 emulator . I have added android-support-v4.jar and specified
in manifest file .can anybody tell what is problem how to solve?
02-03 15:06:08.623: E/AndroidRuntime(223): Uncaught handler: thread main exiting due to uncaught exception
02-03 15:06:08.641: E/AndroidRuntime(223): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.test.fragment/com.test.fragment.FragmentTestWebActivity}: android.view.InflateException: Binary XML file line #13: Error inflating class fragment
02-03 15:06:08.641: E/AndroidRuntime(223): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2496)
02-03 15:06:08.641: E/AndroidRuntime(223): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)
02-03 15:06:08.641: E/AndroidRuntime(223): at android.app.ActivityThread.access$2200(ActivityThread.java:119)
02-03 15:06:08.641: E/AndroidRuntime(223): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)
02-03 15:06:08.641: E/AndroidRuntime(223): at android.os.Handler.dispatchMessage(Handler.java:99)
02-03 15:06:08.641: E/AndroidRuntime(223): at android.os.Looper.loop(Looper.java:123)
02-03 15:06:08.641: E/AndroidRuntime(223): at android.app.ActivityThread.main(ActivityThread.java:4363)
02-03 15:06:08.641: E/AndroidRuntime(223): at java.lang.reflect.Method.invokeNative(Native Method)
02-03 15:06:08.641: E/AndroidRuntime(223): at java.lang.reflect.Method.invoke(Method.java:521)
02-03 15:06:08.641: E/AndroidRuntime(223): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
02-03 15:06:08.641: E/AndroidRuntime(223): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
02-03 15:06:08.641: E/AndroidRuntime(223): at dalvik.system.NativeStart.main(Native Method)
02-03 15:06:08.641: E/AndroidRuntime(223): Caused by: android.view.InflateException: Binary XML file line #13: Error inflating class fragment
02-03 15:06:08.641: E/AndroidRuntime(223): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:576)
02-03 15:06:08.641: E/AndroidRuntime(223): at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)
02-03 15:06:08.641: E/AndroidRuntime(223): at android.view.LayoutInflater.inflate(LayoutInflater.java:407)
02-03 15:06:08.641: E/AndroidRuntime(223): at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
02-03 15:06:08.641: E/AndroidRuntime(223): at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
02-03 15:06:08.641: E/AndroidRuntime(223): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:198)
02-03 15:06:08.641: E/AndroidRuntime(223): at android.app.Activity.setContentView(Activity.java:1622)
02-03 15:06:08.641: E/AndroidRuntime(223): at com.test.fragment.FragmentTestWebActivity.onCreate(FragmentTestWebActivity.java:13)
02-03 15:06:08.641: E/AndroidRuntime(223): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
02-03 15:06:08.641: E/AndroidRuntime(223): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)
02-03 15:06:08.641: E/AndroidRuntime(223): ... 11 more
02-03 15:06:08.641: E/AndroidRuntime(223): Caused by: java.lang.ClassNotFoundException: android.view.fragment in loader dalvik.system.PathClassLoader#48079860
02-03 15:06:08.641: E/AndroidRuntime(223): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
02-03 15:06:08.641: E/AndroidRuntime(223): at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
02-03 15:06:08.641: E/AndroidRuntime(223): at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
02-03 15:06:08.641: E/AndroidRuntime(223): at android.view.LayoutInflater.createView(LayoutInflater.java:466)
02-03 15:06:08.641: E/AndroidRuntime(223): at android.view.LayoutInflater.onCreateView(LayoutInflater.java:544)
02-03 15:06:08.641: E/AndroidRuntime(223): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:66)
02-03 15:06:08.641: E/AndroidRuntime(223): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)
02-03 15:06:08.641: E/AndroidRuntime(223): ... 20 more
thanks
Make sure to import the Fragment from the library. Fragment in later Android versions and Fragment in the compatibility library have different packages!
I have 2 activities. First activity extends Activity and second extends ListActivity.
I need to call ListActivity from the Activity class
I have tried the following.
Intent intent = new Intent(firstclassname.this, secongclassname.class);
startActivity(intent);
I've added an entry in the manifest file but it doen't work.
That same code works for the Activity class (if the second class extends ListActivity)
I got following Logcat output
04-26 15:51:48.235: INFO/ActivityManager(52): Starting activity: Intent { cmp=android.com.testHTML/.FindFilesByType }
04-26 15:51:48.395: ERROR/ArrayAdapter(3113): You must supply a resource ID for a TextView
04-26 15:51:48.395: WARN/dalvikvm(3113): threadid=3: thread exiting with uncaught exception (group=0x4001aa28)
04-26 15:51:48.405: ERROR/AndroidRuntime(3113): Uncaught handler: thread main exiting due to uncaught exception
04-26 15:51:48.414: ERROR/AndroidRuntime(3113): java.lang.IllegalStateException: ArrayAdapter requires the resource ID to be a TextView
04-26 15:51:48.414: ERROR/AndroidRuntime(3113): at android.widget.ArrayAdapter.createViewFromResource(ArrayAdapter.java:347)
04-26 15:51:48.414: ERROR/AndroidRuntime(3113): at android.widget.ArrayAdapter.getView(ArrayAdapter.java:323)
04-26 15:51:48.414: ERROR/AndroidRuntime(3113): at android.widget.AbsListView.obtainView(AbsListView.java:1273)
04-26 15:51:48.414: ERROR/AndroidRuntime(3113): at android.widget.ListView.makeAndAddView(ListView.java:1658)
04-26 15:51:48.414: ERROR/AndroidRuntime(3113): at android.widget.ListView.fillDown(ListView.java:637)
04-26 15:51:48.414: ERROR/AndroidRuntime(3113): at android.widget.ListView.fillFromTop(ListView.java:694)
04-26 15:51:48.414: ERROR/AndroidRuntime(3113): at android.widget.ListView.layoutChildren(ListView.java:1516)
04-26 15:51:48.414: ERROR/AndroidRuntime(3113): at android.widget.AbsListView.onLayout(AbsListView.java:1112)
04-26 15:51:48.414: ERROR/AndroidRuntime(3113): at android.view.View.layout(View.java:6569)
04-26 15:51:48.414: ERROR/AndroidRuntime(3113): at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1119)
04-26 15:51:48.414: ERROR/AndroidRuntime(3113): at android.widget.LinearLayout.layoutHorizontal(LinearLayout.java:1108)
04-26 15:51:48.414: ERROR/AndroidRuntime(3113): at android.widget.LinearLayout.onLayout(LinearLayout.java:920)
04-26 15:51:48.414: ERROR/AndroidRuntime(3113): at android.view.View.layout(View.java:6569)
04-26 15:51:48.414: ERROR/AndroidRuntime(3113): at android.widget.FrameLayout.onLayout(FrameLayout.java:333)
04-26 15:51:48.414: ERROR/AndroidRuntime(3113): at android.view.View.layout(View.java:6569)
04-26 15:51:48.414: ERROR/AndroidRuntime(3113): at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1119)
04-26 15:51:48.414: ERROR/AndroidRuntime(3113): at android.widget.LinearLayout.layoutVertical(LinearLayout.java:998)
04-26 15:51:48.414: ERROR/AndroidRuntime(3113): at android.widget.LinearLayout.onLayout(LinearLayout.java:918)
04-26 15:51:48.414: ERROR/AndroidRuntime(3113): at android.view.View.layout(View.java:6569)
04-26 15:51:48.414: ERROR/AndroidRuntime(3113): at android.widget.FrameLayout.onLayout(FrameLayout.java:333)
04-26 15:51:48.414: ERROR/AndroidRuntime(3113): at android.view.View.layout(View.java:6569)
04-26 15:51:48.414: ERROR/AndroidRuntime(3113): at android.view.ViewRoot.performTraversals(ViewRoot.java:979)
04-26 15:51:48.414: ERROR/AndroidRuntime(3113): at android.view.ViewRoot.handleMessage(ViewRoot.java:1613)
04-26 15:51:48.414: ERROR/AndroidRuntime(3113): at android.os.Handler.dispatchMessage(Handler.java:99)
04-26 15:51:48.414: ERROR/AndroidRuntime(3113): at android.os.Looper.loop(Looper.java:123)
04-26 15:51:48.414: ERROR/AndroidRuntime(3113): at android.app.ActivityThread.main(ActivityThread.java:4203)
04-26 15:51:48.414: ERROR/AndroidRuntime(3113): at java.lang.reflect.Method.invokeNative(Native Method)
04-26 15:51:48.414: ERROR/AndroidRuntime(3113): at java.lang.reflect.Method.invoke(Method.java:521)
04-26 15:51:48.414: ERROR/AndroidRuntime(3113): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)
04-26 15:51:48.414: ERROR/AndroidRuntime(3113): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)
04-26 15:51:48.414: ERROR/AndroidRuntime(3113): at dalvik.system.NativeStart.main(Native Method)
04-26 15:51:48.414: ERROR/AndroidRuntime(3113): Caused by: java.lang.ClassCastException: android.widget.LinearLayout
04-26 15:51:48.414: ERROR/AndroidRuntime(3113): at android.widget.ArrayAdapter.createViewFromResource(ArrayAdapter.java:340)
04-26 15:51:48.414: ERROR/AndroidRuntime(3113): ... 30 more
04-26 15:51:48.436: INFO/Process(52): Sending signal. PID: 3113 SIG: 3
04-26 15:51:48.446: INFO/dalvikvm(3113): threadid=7: reacting to signal 3
04-26 15:51:48.446: ERROR/dalvikvm(3113): Unable to open stack trace file '/data/anr/traces.txt': Permission denied
04-26 15:51:58.289: WARN/ActivityManager(52): Launch timeout has expired, giving up wake lock!
04-26 15:51:58.289: WARN/ActivityManager(52): Activity idle timeout for HistoryRecord{4391c898 android.com.testHTML/.FindFilesByType}
What am I doing wrong?
Your activity is properly started.
The problem is in ArrayAdapter that you are using. You are not providing the resource id of the TextView.
Check out which constructor you are using and provide the correct parameters.