force close when change theme in android manifest - android

I have changed the theme for some activities, but when I want to run the AVD go to Force Stop.
This is my activity manifest:
<activity
android:name="com.example.gpsportalsms.LoginActivity"
android:theme="#android:style/Theme.Translucent."
android:label="#string/title_activity_login" >
<intent-filter>
and this is my xml activity:
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.gpsportalsms.LoginActivity"
android:background="#drawable/background3"
tools:ignore="MergeRootFrame" >
</FrameLayout>
I add the LogCat in below:
06-29 16:10:24.015: W/dalvikvm(1420): threadid=1: thread exiting with uncaught exception (group=0xa4ceeb20)
06-29 16:10:24.015: E/AndroidRuntime(1420): FATAL EXCEPTION: main
06-29 16:10:24.015: E/AndroidRuntime(1420): Process: com.example.gpsportalsms, PID: 1420
06-29 16:10:24.015: E/AndroidRuntime(1420): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.gpsportalsms/com.example.gpsportalsms.NotifySMSReceived}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
06-29 16:10:24.015: E/AndroidRuntime(1420): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2195)
06-29 16:10:24.015: E/AndroidRuntime(1420): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
06-29 16:10:24.015: E/AndroidRuntime(1420): at android.app.ActivityThread.access$800(ActivityThread.java:135)
06-29 16:10:24.015: E/AndroidRuntime(1420): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
06-29 16:10:24.015: E/AndroidRuntime(1420): at android.os.Handler.dispatchMessage(Handler.java:102)
06-29 16:10:24.015: E/AndroidRuntime(1420): at android.os.Looper.loop(Looper.java:136)
06-29 16:10:24.015: E/AndroidRuntime(1420): at android.app.ActivityThread.main(ActivityThread.java:5017)
06-29 16:10:24.015: E/AndroidRuntime(1420): at java.lang.reflect.Method.invokeNative(Native Method)
06-29 16:10:24.015: E/AndroidRuntime(1420): at java.lang.reflect.Method.invoke(Method.java:515)
06-29 16:10:24.015: E/AndroidRuntime(1420): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
06-29 16:10:24.015: E/AndroidRuntime(1420): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
06-29 16:10:24.015: E/AndroidRuntime(1420): at dalvik.system.NativeStart.main(Native Method)
06-29 16:10:24.015: E/AndroidRuntime(1420): Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
06-29 16:10:24.015: E/AndroidRuntime(1420): at android.support.v7.app.ActionBarActivityDelegate.onCreate(ActionBarActivityDelegate.java:108)
06-29 16:10:24.015: E/AndroidRuntime(1420): at android.support.v7.app.ActionBarActivityDelegateICS.onCreate(ActionBarActivityDelegateICS.java:57)
06-29 16:10:24.015: E/AndroidRuntime(1420): at android.support.v7.app.ActionBarActivity.onCreate(ActionBarActivity.java:98)
06-29 16:10:24.015: E/AndroidRuntime(1420): at com.example.gpsportalsms.NotifySMSReceived.onCreate(NotifySMSReceived.java:20)
06-29 16:10:24.015: E/AndroidRuntime(1420): at android.app.Activity.performCreate(Activity.java:5231)
06-29 16:10:24.015: E/AndroidRuntime(1420): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
06-29 16:10:24.015: E/AndroidRuntime(1420): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
06-29 16:10:24.015: E/AndroidRuntime(1420): ... 11 more
What is wrong?

Remove the "." in Theme.Translucent.
Use this
<activity
android:name="com.example.gpsportalsms.LoginActivity"
android:theme="#android:style/Theme.Translucent"
android:label="#string/title_activity_login" >

A quick search lands me into this SO question : How to make an Android Translucent theme a little darker?
The mentioned question however isn't much related to yours, but provides some reference. Haven't tried though.
As it says the code must be like
<activity
android:name="com.example.gpsportalsms.LoginActivity"
android:theme="#android:style/Theme.Translucent"
android:label="#string/title_activity_login" >
Notice the '.' shouldn't be there.

Related

Where get database path in database open helper?

I try to get the database path in the constructor of database helper class like this:
public DB_Nabege_helper(Context context) {
super(context, DBname, null, 1);
Nabege_context = context;
DBpath=Nabege_context.getDatabasePath(DBname).getPath();
}
When run app : crashed app
10-15 16:41:37.164: E/AndroidRuntime(1420): FATAL EXCEPTION: main
10-15 16:41:37.164: E/AndroidRuntime(1420): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.nabproduct.nabege/com.nabproduct.nabege.Collection_List_Activity}: java.lang.NullPointerException
10-15 16:41:37.164: E/AndroidRuntime(1420): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1983)
10-15 16:41:37.164: E/AndroidRuntime(1420): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
10-15 16:41:37.164: E/AndroidRuntime(1420): at android.app.ActivityThread.access$600(ActivityThread.java:130)
10-15 16:41:37.164: E/AndroidRuntime(1420): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
10-15 16:41:37.164: E/AndroidRuntime(1420): at android.os.Handler.dispatchMessage(Handler.java:99)
10-15 16:41:37.164: E/AndroidRuntime(1420): at android.os.Looper.loop(Looper.java:137)
10-15 16:41:37.164: E/AndroidRuntime(1420): at android.app.ActivityThread.main(ActivityThread.java:4745)
10-15 16:41:37.164: E/AndroidRuntime(1420): at java.lang.reflect.Method.invokeNative(Native Method)
10-15 16:41:37.164: E/AndroidRuntime(1420): at java.lang.reflect.Method.invoke(Method.java:511)
10-15 16:41:37.164: E/AndroidRuntime(1420): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
10-15 16:41:37.164: E/AndroidRuntime(1420): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
10-15 16:41:37.164: E/AndroidRuntime(1420): at dalvik.system.NativeStart.main(Native Method)
10-15 16:41:37.164: E/AndroidRuntime(1420): Caused by: java.lang.NullPointerException
10-15 16:41:37.164: E/AndroidRuntime(1420): at android.content.ContextWrapper.getDatabasePath(ContextWrapper.java:231)
10-15 16:41:37.164: E/AndroidRuntime(1420): at com.nabproduct.nabege.DB_Nabege_helper.<init>(DB_Nabege_helper.java:44)
10-15 16:41:37.164: E/AndroidRuntime(1420): at com.nabproduct.nabege.Collection_List_Activity.<init>(Collection_List_Activity.java:165)
10-15 16:41:37.164: E/AndroidRuntime(1420): at java.lang.Class.newInstanceImpl(Native Method)
10-15 16:41:37.164: E/AndroidRuntime(1420): at java.lang.Class.newInstance(Class.java:1319)
10-15 16:41:37.164: E/AndroidRuntime(1420): at android.app.Instrumentation.newActivity(Instrumentation.java:1053)
10-15 16:41:37.164: E/AndroidRuntime(1420): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1974)
I add more code as an answer.
I see from the stacktrace that you create DB helper in the activity constructor or field initializer possibly. In both cases activity isn't initialized yet (moreover you don't need to override activity constructor in the most cases). Move DB helper assignment inside the activity onCreate() method.

Crash issue in OnResume

If application stay in background mode more then 5 min. after that i try to open Application at that time got crash issue my Error log is here help me thanks in Advance....
java.lang.RuntimeException: Unable to start activity` ComponentInfo{com.gamestruct.TweetBoostAndroid/com.gamestruct.TweetBoostAndroid.TabbedActivity}: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.gamestruct.TweetBoostAndroid/com.gamestruct.TweetBoostAndroid.EarnCoinActivity}: java.lang.NullPointerException
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2205)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2255)
at android.app.ActivityThread.access$800(ActivityThread.java:142)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1203)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5118)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:792)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:608)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.gamestruct.TweetBoostAndroid/com.gamestruct.TweetBoostAndroid.EarnCoinActivity}: java.lang.NullPointerException
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2205)
at android.app.ActivityThread.startActivityNow(ActivityThread.java:2043)
at android.app.LocalActivityManager.moveToState(LocalActivityManager.java:135)
at android.app.LocalActivityManager.startActivity(LocalActivityManager.java:347)
at android.widget.TabHost$IntentContentStrategy.getContentView(TabHost.java:749)
at android.widget.TabHost.setCurrentTab(TabHost.java:413)
at android.widget.TabHost.addTab(TabHost.java:240)
at com.gamestruct.TweetBoostAndroid.TabbedActivity.addTab(TabbedActivity.java:199)
at com.gamestruct.TweetBoostAndroid.TabbedActivity.setTabs(TabbedActivity.java:180)
at com.gamestruct.TweetBoostAndroid.TabbedActivity.onCreate(TabbedActivity.java:140)
at android.app.Activity.performCreate(Activity.java:5275)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2169)
... 11 more
Caused by: java.lang.NullPointerException
at com.gamestruct.TweetBoostAndroid.EarnCoinActivity.onCreate(EarnCoinActivity.java:110)
at android.app.Activity.performCreate(Activity.java:5275)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2169)
... 23 more
While your application stayed in the background it got killed by the system. Somewhere in com.gamestruct.TweetBoostAndroid.EarnCoinActivity.onCreate (presumably on line 110) you are using something that became null as your app was killed.

style runtime errors occures

when I change the value in the values-v14/styles.xml file from:
parent="Theme.AppCompat.Light.DarkActionBar" to:
parent="android:Theme.Holo"
the application crushes and the logcat says: runtime error!
what should I do?
Here's the logcat:
10-12 09:09:29.850: E/AndroidRuntime(1910): FATAL EXCEPTION: main
10-12 09:09:29.850: E/AndroidRuntime(1910): Process: absolute.begginners.hellouniverse, PID: 1910
10-12 09:09:29.850: E/AndroidRuntime(1910): java.lang.RuntimeException: Unable to start activity ComponentInfo{absolute.begginners.hellouniverse/absolute.begginners.hellouniverse.MainActivity}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
10-12 09:09:29.850: E/AndroidRuntime(1910): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2195)
10-12 09:09:29.850: E/AndroidRuntime(1910): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
10-12 09:09:29.850: E/AndroidRuntime(1910): at android.app.ActivityThread.access$800(ActivityThread.java:135)
10-12 09:09:29.850: E/AndroidRuntime(1910): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
10-12 09:09:29.850: E/AndroidRuntime(1910): at android.os.Handler.dispatchMessage(Handler.java:102)
10-12 09:09:29.850: E/AndroidRuntime(1910): at android.os.Looper.loop(Looper.java:136)
10-12 09:09:29.850: E/AndroidRuntime(1910): at android.app.ActivityThread.main(ActivityThread.java:5017)
10-12 09:09:29.850: E/AndroidRuntime(1910): at java.lang.reflect.Method.invokeNative(Native Method) 10-12 09:09:29.850: E/AndroidRuntime(1910): at java.lang.reflect.Method.invoke(Method.java:515)
10-12 09:09:29.850: E/AndroidRuntime(1910): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
10-12 09:09:29.850: E/AndroidRuntime(1910): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
10-12 09:09:29.850: E/AndroidRuntime(1910): at dalvik.system.NativeStart.main(Native Method)
10-12 09:09:29.850: E/AndroidRuntime(1910): Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
10-12 09:09:29.850: E/AndroidRuntime(1910): at android.support.v7.app.ActionBarActivityDelegate.onCreate(ActionBarActivityDelegate.java:110)10-12 09:09:29.850: E/AndroidRuntime(1910): at android.support.v7.app.ActionBarActivityDelegateICS.onCreate(ActionBarActivityDelegateICS.java:57)
10-12 09:09:29.850: E/AndroidRuntime(1910): at android.support.v7.app.ActionBarActivity.onCreate(ActionBarActivity.java:99)
10-12 09:09:29.850: E/AndroidRuntime(1910): at absolute.begginners.hellouniverse.MainActivity.onCreate(MainActivity.java:13)
10-12 09:09:29.850: E/AndroidRuntime(1910): at android.app.Activity.performCreate(Activity.java:5231)
10-12 09:09:29.850: E/AndroidRuntime(1910): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
10-12 09:09:29.850: E/AndroidRuntime(1910): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
10-12 09:09:29.850: E/AndroidRuntime(1910): ... 11 more
Your class extends ActionBarActivity that's why you can only use the AppCompat theme.
If you want to use holo, make your class extend Activity. Example
public class MainActivity extends Activity {
...
}
I had to set my main.xml to the following
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
</style>

Display Google Maps on second screen of Android application

I know how to launch a new activity within my application, i.e. like continuing to a new screen. In my app when I continue to next screen I would like to display google maps. I can display google maps fine on a one screen application. I'm not sure how to go about this, any help would be greatly appreciated, a the moment it crashes when I try to launch the new activity.
MainActivity class->
package com.example.drivetext;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
public class MainActivity extends Activity {
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Button b = (Button) findViewById(R.id.btnClick);
b.setOnClickListener(new View.OnClickListener() {
public void onClick(View arg0) {
// here i call new screen;
Intent i = new Intent(MainActivity.this, setdestination.class);
startActivity(i);
}
});
}
}
setdestination class->
package com.example.drivetext;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.MapFragment;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.Marker;
import com.google.android.gms.maps.model.MarkerOptions;
import android.os.Bundle;
import android.app.Activity;
public class setdestination extends Activity {
static final LatLng TutorialsPoint = new LatLng(21 , 57);
private GoogleMap googleMap;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.setdestination);
try {
if (googleMap == null) {
googleMap = ((MapFragment) getFragmentManager().
findFragmentById(R.id.map)).getMap();
}
googleMap.setMapType(GoogleMap.MAP_TYPE_HYBRID);
Marker TP = googleMap.addMarker(new MarkerOptions().
position(TutorialsPoint).title("TutorialsPoint"));
} catch (Exception e) {
e.printStackTrace();
}
}
}
Android Manifest->
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.drivetext"
android:versionCode="1"
android:versionName="1.0" >
<uses-permission android:name="com.example.drivetext.permission.MAPS_RECEIVE" />
<uses-sdk
android:minSdkVersion="12"
android:targetSdkVersion="19" />
<permission
android:name="com.example.drivetext.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.example.drivetext.MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".setdestination" android:label="SetDestination"> </activity>
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyC4VQ7nzxjPSjfObnnKqZxMZUOHACNNmP0" />
</application>
</manifest>
setdestination.xml->
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<fragment
android:id="#+id/map"
android:name="com.google.android.gms.maps.MapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</RelativeLayout>
Logcat output->
05-02 19:30:37.274: D/gralloc_goldfish(1443): Emulator without GPU emulation detected.
05-02 19:30:40.134: I/Choreographer(1443): Skipped 51 frames! The application may be doing too much work on its main thread.
05-02 19:30:40.894: W/GooglePlayServicesUtil(1443): Google Play services is missing.
05-02 19:30:40.904: W/GooglePlayServicesUtil(1443): Google Play services is missing.
05-02 19:30:40.904: W/GooglePlayServicesUtil(1443): Google Play services is missing.
05-02 19:30:40.974: W/GooglePlayServicesUtil(1443): Google Play services is missing.
05-02 19:30:40.984: W/GooglePlayServicesUtil(1443): Google Play services is missing.
05-02 19:30:41.044: W/GooglePlayServicesUtil(1443): Google Play services is missing.
05-02 19:30:41.084: W/GooglePlayServicesUtil(1443): Google Play services is missing.
05-02 19:30:41.094: W/GooglePlayServicesUtil(1443): Google Play services is missing.
05-02 19:30:41.104: W/GooglePlayServicesUtil(1443): Google Play services is missing.
05-02 19:30:41.194: W/GooglePlayServicesUtil(1443): Google Play services is missing.
05-02 19:30:41.234: W/GooglePlayServicesUtil(1443): Google Play services is missing.
05-02 19:30:41.234: D/AndroidRuntime(1443): Shutting down VM
05-02 19:30:41.234: W/dalvikvm(1443): threadid=1: thread exiting with uncaught exception (group=0xb4ac5ba8)
05-02 19:30:41.304: E/AndroidRuntime(1443): FATAL EXCEPTION: main
05-02 19:30:41.304: E/AndroidRuntime(1443): Process: com.example.drivetext, PID: 1443
05-02 19:30:41.304: E/AndroidRuntime(1443): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.drivetext/com.example.drivetext.setdestination}: java.lang.NullPointerException
05-02 19:30:41.304: E/AndroidRuntime(1443): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2195)
05-02 19:30:41.304: E/AndroidRuntime(1443): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
05-02 19:30:41.304: E/AndroidRuntime(1443): at android.app.ActivityThread.access$800(ActivityThread.java:135)
05-02 19:30:41.304: E/AndroidRuntime(1443): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
05-02 19:30:41.304: E/AndroidRuntime(1443): at android.os.Handler.dispatchMessage(Handler.java:102)
05-02 19:30:41.304: E/AndroidRuntime(1443): at android.os.Looper.loop(Looper.java:136)
05-02 19:30:41.304: E/AndroidRuntime(1443): at android.app.ActivityThread.main(ActivityThread.java:5017)
05-02 19:30:41.304: E/AndroidRuntime(1443): at java.lang.reflect.Method.invokeNative(Native Method)
05-02 19:30:41.304: E/AndroidRuntime(1443): at java.lang.reflect.Method.invoke(Method.java:515)
05-02 19:30:41.304: E/AndroidRuntime(1443): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
05-02 19:30:41.304: E/AndroidRuntime(1443): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
05-02 19:30:41.304: E/AndroidRuntime(1443): at dalvik.system.NativeStart.main(Native Method)
05-02 19:30:41.304: E/AndroidRuntime(1443): Caused by: java.lang.NullPointerException
05-02 19:30:41.304: E/AndroidRuntime(1443): at com.example.drivetext.setdestination.onCreate(setdestination.java:20)
05-02 19:30:41.304: E/AndroidRuntime(1443): at android.app.Activity.performCreate(Activity.java:5231)
05-02 19:30:41.304: E/AndroidRuntime(1443): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
05-02 19:30:41.304: E/AndroidRuntime(1443): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
05-02 19:30:41.304: E/AndroidRuntime(1443): ... 11 more
05-02 19:30:44.104: I/Process(1443): Sending signal. PID: 1443 SIG: 9
05-02 19:49:25.004: D/gralloc_goldfish(1497): Emulator without GPU emulation detected.
05-02 19:49:27.224: I/Choreographer(1497): Skipped 34 frames! The application may be doing too much work on its main thread.
05-02 19:49:27.904: W/System.err(1497): java.lang.NullPointerException
05-02 19:49:27.904: W/System.err(1497): at com.example.drivetext.setdestination.onCreate(setdestination.java:22)
05-02 19:49:27.914: W/System.err(1497): at android.app.Activity.performCreate(Activity.java:5231)
05-02 19:49:27.914: W/System.err(1497): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
05-02 19:49:27.914: W/System.err(1497): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
05-02 19:49:27.914: W/System.err(1497): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
05-02 19:49:27.914: W/System.err(1497): at android.app.ActivityThread.access$800(ActivityThread.java:135)
05-02 19:49:27.914: W/System.err(1497): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
05-02 19:49:27.914: W/System.err(1497): at android.os.Handler.dispatchMessage(Handler.java:102)
05-02 19:49:27.914: W/System.err(1497): at android.os.Looper.loop(Looper.java:136)
05-02 19:49:27.914: W/System.err(1497): at android.app.ActivityThread.main(ActivityThread.java:5017)
05-02 19:49:27.944: W/System.err(1497): at java.lang.reflect.Method.invokeNative(Native Method)
05-02 19:49:27.944: W/System.err(1497): at java.lang.reflect.Method.invoke(Method.java:515)
05-02 19:49:27.944: W/System.err(1497): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
05-02 19:49:27.964: W/System.err(1497): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
05-02 19:49:27.964: W/System.err(1497): at dalvik.system.NativeStart.main(Native Method)
05-02 19:49:28.594: I/Choreographer(1497): Skipped 40 frames! The application may be doing too much work on its main thread.
05-02 19:50:41.204: I/Choreographer(1497): Skipped 280 frames! The application may be doing too much work on its main thread.
05-02 19:50:42.324: I/Choreographer(1497): Skipped 40 frames! The application may be doing too much work on its main thread.
05-02 19:50:46.424: I/Choreographer(1497): Skipped 71 frames! The application may be doing too much work on its main thread.
05-02 19:51:25.034: D/gralloc_goldfish(1554): Emulator without GPU emulation detected.
05-02 19:51:27.894: D/AndroidRuntime(1554): Shutting down VM
05-02 19:51:27.904: W/dalvikvm(1554): threadid=1: thread exiting with uncaught exception (group=0xb4ac5ba8)
05-02 19:51:28.034: E/AndroidRuntime(1554): FATAL EXCEPTION: main
05-02 19:51:28.034: E/AndroidRuntime(1554): Process: com.example.drivetext, PID: 1554
05-02 19:51:28.034: E/AndroidRuntime(1554): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.drivetext/com.example.drivetext.setdestination}: android.view.InflateException: Binary XML file line #6: Error inflating class fragment
05-02 19:51:28.034: E/AndroidRuntime(1554): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2195)
05-02 19:51:28.034: E/AndroidRuntime(1554): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
05-02 19:51:28.034: E/AndroidRuntime(1554): at android.app.ActivityThread.access$800(ActivityThread.java:135)
05-02 19:51:28.034: E/AndroidRuntime(1554): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
05-02 19:51:28.034: E/AndroidRuntime(1554): at android.os.Handler.dispatchMessage(Handler.java:102)
05-02 19:51:28.034: E/AndroidRuntime(1554): at android.os.Looper.loop(Looper.java:136)
05-02 19:51:28.034: E/AndroidRuntime(1554): at android.app.ActivityThread.main(ActivityThread.java:5017)
05-02 19:51:28.034: E/AndroidRuntime(1554): at java.lang.reflect.Method.invokeNative(Native Method)
05-02 19:51:28.034: E/AndroidRuntime(1554): at java.lang.reflect.Method.invoke(Method.java:515)
05-02 19:51:28.034: E/AndroidRuntime(1554): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
05-02 19:51:28.034: E/AndroidRuntime(1554): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
05-02 19:51:28.034: E/AndroidRuntime(1554): at dalvik.system.NativeStart.main(Native Method)
05-02 19:51:28.034: E/AndroidRuntime(1554): Caused by: android.view.InflateException: Binary XML file line #6: Error inflating class fragment
05-02 19:51:28.034: E/AndroidRuntime(1554): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:713)
05-02 19:51:28.034: E/AndroidRuntime(1554): at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
05-02 19:51:28.034: E/AndroidRuntime(1554): at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
05-02 19:51:28.034: E/AndroidRuntime(1554): at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
05-02 19:51:28.034: E/AndroidRuntime(1554): at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
05-02 19:51:28.034: E/AndroidRuntime(1554): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:290)
05-02 19:51:28.034: E/AndroidRuntime(1554): at android.app.Activity.setContentView(Activity.java:1929)
05-02 19:51:28.034: E/AndroidRuntime(1554): at com.example.drivetext.setdestination.onCreate(setdestination.java:18)
05-02 19:51:28.034: E/AndroidRuntime(1554): at android.app.Activity.performCreate(Activity.java:5231)
05-02 19:51:28.034: E/AndroidRuntime(1554): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
05-02 19:51:28.034: E/AndroidRuntime(1554): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
05-02 19:51:28.034: E/AndroidRuntime(1554): ... 11 more
05-02 19:51:28.034: E/AndroidRuntime(1554): Caused by: java.lang.IllegalStateException: The meta-data tag in your app's AndroidManifest.xml does not have the right value. Expected 4323000 but found 0. You must have the following declaration within the <application> element: <meta-data android:name="com.google.android.gms.version" android:value="#integer/google_play_services_version" />
05-02 19:51:28.034: E/AndroidRuntime(1554): at com.google.android.gms.common.GooglePlayServicesUtil.t(Unknown Source)
05-02 19:51:28.034: E/AndroidRuntime(1554): at com.google.android.gms.common.GooglePlayServicesUtil.isGooglePlayServicesAvailable(Unknown Source)
05-02 19:51:28.034: E/AndroidRuntime(1554): at com.google.android.gms.maps.internal.q.B(Unknown Source)
05-02 19:51:28.034: E/AndroidRuntime(1554): at com.google.android.gms.maps.internal.q.A(Unknown Source)
05-02 19:51:28.034: E/AndroidRuntime(1554): at com.google.android.gms.maps.MapsInitializer.initialize(Unknown Source)
05-02 19:51:28.034: E/AndroidRuntime(1554): at com.google.android.gms.maps.MapFragment$b.gW(Unknown Source)
05-02 19:51:28.034: E/AndroidRuntime(1554): at com.google.android.gms.maps.MapFragment$b.a(Unknown Source)
05-02 19:51:28.034: E/AndroidRuntime(1554): at com.google.android.gms.dynamic.a.a(Unknown Source)
05-02 19:51:28.034: E/AndroidRuntime(1554): at com.google.android.gms.dynamic.a.onInflate(Unknown Source)
05-02 19:51:28.034: E/AndroidRuntime(1554): at com.google.android.gms.maps.MapFragment.onInflate(Unknown Source)
05-02 19:51:28.034: E/AndroidRuntime(1554): at android.app.Activity.onCreateView(Activity.java:4785)
05-02 19:51:28.034: E/AndroidRuntime(1554): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:689)
05-02 19:51:28.034: E/AndroidRuntime(1554): ... 21 more
05-02 19:51:32.334: I/Process(1554): Sending signal. PID: 1554 SIG: 9
05-02 19:54:42.454: D/gralloc_goldfish(1606): Emulator without GPU emulation detected.
05-02 19:54:51.254: I/Choreographer(1606): Skipped 36 frames! The application may be doing too much work on its main thread.
05-02 19:54:51.924: D/AndroidRuntime(1606): Shutting down VM
05-02 19:54:51.924: W/dalvikvm(1606): threadid=1: thread exiting with uncaught exception (group=0xb4ac5ba8)
05-02 19:54:52.064: E/AndroidRuntime(1606): FATAL EXCEPTION: main
05-02 19:54:52.064: E/AndroidRuntime(1606): Process: com.example.drivetext, PID: 1606
05-02 19:54:52.064: E/AndroidRuntime(1606): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.drivetext/com.example.drivetext.setdestination}: android.view.InflateException: Binary XML file line #6: Error inflating class fragment
05-02 19:54:52.064: E/AndroidRuntime(1606): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2195)
05-02 19:54:52.064: E/AndroidRuntime(1606): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
05-02 19:54:52.064: E/AndroidRuntime(1606): at android.app.ActivityThread.access$800(ActivityThread.java:135)
05-02 19:54:52.064: E/AndroidRuntime(1606): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
05-02 19:54:52.064: E/AndroidRuntime(1606): at android.os.Handler.dispatchMessage(Handler.java:102)
05-02 19:54:52.064: E/AndroidRuntime(1606): at android.os.Looper.loop(Looper.java:136)
05-02 19:54:52.064: E/AndroidRuntime(1606): at android.app.ActivityThread.main(ActivityThread.java:5017)
05-02 19:54:52.064: E/AndroidRuntime(1606): at java.lang.reflect.Method.invokeNative(Native Method)
05-02 19:54:52.064: E/AndroidRuntime(1606): at java.lang.reflect.Method.invoke(Method.java:515)
05-02 19:54:52.064: E/AndroidRuntime(1606): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
05-02 19:54:52.064: E/AndroidRuntime(1606): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
05-02 19:54:52.064: E/AndroidRuntime(1606): at dalvik.system.NativeStart.main(Native Method)
05-02 19:54:52.064: E/AndroidRuntime(1606): Caused by: android.view.InflateException: Binary XML file line #6: Error inflating class fragment
05-02 19:54:52.064: E/AndroidRuntime(1606): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:713)
05-02 19:54:52.064: E/AndroidRuntime(1606): at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
05-02 19:54:52.064: E/AndroidRuntime(1606): at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
05-02 19:54:52.064: E/AndroidRuntime(1606): at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
05-02 19:54:52.064: E/AndroidRuntime(1606): at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
05-02 19:54:52.064: E/AndroidRuntime(1606): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:290)
05-02 19:54:52.064: E/AndroidRuntime(1606): at android.app.Activity.setContentView(Activity.java:1929)
05-02 19:54:52.064: E/AndroidRuntime(1606): at com.example.drivetext.setdestination.onCreate(setdestination.java:18)
05-02 19:54:52.064: E/AndroidRuntime(1606): at android.app.Activity.performCreate(Activity.java:5231)
05-02 19:54:52.064: E/AndroidRuntime(1606): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
05-02 19:54:52.064: E/AndroidRuntime(1606): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
05-02 19:54:52.064: E/AndroidRuntime(1606): ... 11 more
05-02 19:54:52.064: E/AndroidRuntime(1606): Caused by: java.lang.IllegalStateException: The meta-data tag in your app's AndroidManifest.xml does not have the right value. Expected 4323000 but found 0. You must have the following declaration within the <application> element: <meta-data android:name="com.google.android.gms.version" android:value="#integer/google_play_services_version" />
05-02 19:54:52.064: E/AndroidRuntime(1606): at com.google.android.gms.common.GooglePlayServicesUtil.t(Unknown Source)
05-02 19:54:52.064: E/AndroidRuntime(1606): at com.google.android.gms.common.GooglePlayServicesUtil.isGooglePlayServicesAvailable(Unknown Source)
05-02 19:54:52.064: E/AndroidRuntime(1606): at com.google.android.gms.maps.internal.q.B(Unknown Source)
05-02 19:54:52.064: E/AndroidRuntime(1606): at com.google.android.gms.maps.internal.q.A(Unknown Source)
05-02 19:54:52.064: E/AndroidRuntime(1606): at com.google.android.gms.maps.MapsInitializer.initialize(Unknown Source)
05-02 19:54:52.064: E/AndroidRuntime(1606): at com.google.android.gms.maps.MapFragment$b.gW(Unknown Source)
05-02 19:54:52.064: E/AndroidRuntime(1606): at com.google.android.gms.maps.MapFragment$b.a(Unknown Source)
05-02 19:54:52.064: E/AndroidRuntime(1606): at com.google.android.gms.dynamic.a.a(Unknown Source)
05-02 19:54:52.064: E/AndroidRuntime(1606): at com.google.android.gms.dynamic.a.onInflate(Unknown Source)
05-02 19:54:52.064: E/AndroidRuntime(1606): at com.google.android.gms.maps.MapFragment.onInflate(Unknown Source)
05-02 19:54:52.064: E/AndroidRuntime(1606): at android.app.Activity.onCreateView(Activity.java:4785)
05-02 19:54:52.064: E/AndroidRuntime(1606): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:689)
05-02 19:54:52.064: E/AndroidRuntime(1606): ... 21 more
05-02 19:54:55.424: I/Process(1606): Sending signal. PID: 1606 SIG: 9
The Error means that your current emulator is does not support Goolgle Play Service
Click here for more info on how to update your emulator to support google service
You missed out <meta-data> in your Android Manifest
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
Try adding this..

What is this error while building a project in android?

I get this error !! Class Not found ..
please check the following error log
06-29 09:09:59.384: ERROR/AndroidRuntime(545): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{s.s/s.s.MainActivity}: java.lang.ClassNotFoundException: s.s.MainActivity in loader dalvik.system.PathClassLoader[/data/app/s.s-2.apk]
06-29 09:09:59.384: ERROR/AndroidRuntime(545): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1544)
06-29 09:09:59.384: ERROR/AndroidRuntime(545): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1638)
06-29 09:09:59.384: ERROR/AndroidRuntime(545): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
06-29 09:09:59.384: ERROR/AndroidRuntime(545): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:928)
06-29 09:09:59.384: ERROR/AndroidRuntime(545): at android.os.Handler.dispatchMessage(Handler.java:99)
06-29 09:09:59.384: ERROR/AndroidRuntime(545): at android.os.Looper.loop(Looper.java:123)
06-29 09:09:59.384: ERROR/AndroidRuntime(545): at android.app.ActivityThread.main(ActivityThread.java:3647)
06-29 09:09:59.384: ERROR/AndroidRuntime(545): at java.lang.reflect.Method.invokeNative(Native Method)
06-29 09:09:59.384: ERROR/AndroidRuntime(545): at java.lang.reflect.Method.invoke(Method.java:507)
06-29 09:09:59.384: ERROR/AndroidRuntime(545): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
06-29 09:09:59.384: ERROR/AndroidRuntime(545): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
06-29 09:09:59.384: ERROR/AndroidRuntime(545): at dalvik.system.NativeStart.main(Native Method)
06-29 09:09:59.384: ERROR/AndroidRuntime(545): Caused by: java.lang.ClassNotFoundException: s.s.MainActivity in loader dalvik.system.PathClassLoader[/data/app/s.s-2.apk]
06-29 09:09:59.384: ERROR/AndroidRuntime(545): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
06-29 09:09:59.384: ERROR/AndroidRuntime(545): at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
06-29 09:09:59.384: ERROR/AndroidRuntime(545): at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
06-29 09:09:59.384: ERROR/AndroidRuntime(545): at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
06-29 09:09:59.384: ERROR/AndroidRuntime(545): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1536)
06-29 09:09:59.384: ERROR/AndroidRuntime(545): ... 11 more
Well, it means that the class is not found :-)
Do you have a class called s.s.MainActivity? Have you misspelled it (disagreement in the spelling between your manifest and source?). Are you accidentally stripping it out of your apk with ProGuard?
Have a look at your Manifestfile... I think not adding the activity there, would cause this problem.
Should look something like this:
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

Categories

Resources