What's the reason for this error? I only get the error at certain times when I press the textview.
12 12:30:24.301: ERROR/AndroidRuntime(380): java.lang.NullPointerException
12-12 12:30:24.301: ERROR/AndroidRuntime(380): at gps.app.tkartor.Tkartor.onClick(Tkartor.java:195)
12-12 12:30:24.301: ERROR/AndroidRuntime(380): at android.view.View.performClick(View.java:2408)
12-12 12:30:24.301: ERROR/AndroidRuntime(380): at android.view.View$PerformClick.run(View.java:8816)
12-12 12:30:24.301: ERROR/AndroidRuntime(380): at android.os.Handler.handleCallback(Handler.java:587)
12-12 12:30:24.301: ERROR/AndroidRuntime(380): at android.os.Handler.dispatchMessage(Handler.java:92)
12-12 12:30:24.301: ERROR/AndroidRuntime(380): at android.os.Looper.loop(Looper.java:123)
12-12 12:30:24.301: ERROR/AndroidRuntime(380): at android.app.ActivityThread.main(ActivityThread.java:4627)
12-12 12:30:24.301: ERROR/AndroidRuntime(380): at java.lang.reflect.Method.invokeNative(Native Method)
12-12 12:30:24.301: ERROR/AndroidRuntime(380): at java.lang.reflect.Method.invoke(Method.java:521)
12-12 12:30:24.301: ERROR/AndroidRuntime(380): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
12-12 12:30:24.301: ERROR/AndroidRuntime(380): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
12-12 12:30:24.301: ERROR/AndroidRuntime(380): at dalvik.system.NativeStart.main(Native Method)
<TextView android:id="#+id/tvReload" style="#style/ButtonText"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_centerHorizontal="true" android:text="PRESS TO RELOAD"
android:textStyle="bold" android:layout_alignParentBottom="true"
android:textSize="12sp" android:clickable="true" />
java.lang.NullPointerException
Occurs when your object is null or not initiallized & you are trying to access it.
Crosscheck whether all your objects are properly initialized.
Specially in your code Check line number 195 of Tkartor.java file, there you have atleast one object null.
Related
i have implemented a CursorTreeAdapter, and im using it to fetch data from a sqlite Database which contains information about days. Now i want those days to be grouped as months. for that i implemented a Cursor returning a list of Months + Years, and a child cursor that retrieves the days that are supposed to be in that group.
My group cursor seems to be running just fine, i get the mm.YYYY as a group header, at least on some older devices, tested it on a newer one and there it crashes for no obvious reasons. As it doesn't contain any code from my project, im not really sure about how to fix this.
12-12 12:54:38.671: E/AndroidRuntime(11329): FATAL EXCEPTION: main
12-12 12:54:38.671: E/AndroidRuntime(11329): java.lang.IllegalStateException: Couldn't read row 0, col -1 from CursorWindow. Make sure the Cursor is initialized correctly before accessing data from it.
12-12 12:54:38.671: E/AndroidRuntime(11329): at android.database.CursorWindow.nativeGetLong(Native Method)
12-12 12:54:38.671: E/AndroidRuntime(11329): at android.database.CursorWindow.getLong(CursorWindow.java:507)
12-12 12:54:38.671: E/AndroidRuntime(11329): at android.database.AbstractWindowedCursor.getLong(AbstractWindowedCursor.java:75)
12-12 12:54:38.671: E/AndroidRuntime(11329): at android.widget.CursorTreeAdapter$MyCursorHelper.getId(CursorTreeAdapter.java:436)
12-12 12:54:38.671: E/AndroidRuntime(11329): at android.widget.CursorTreeAdapter.getGroupId(CursorTreeAdapter.java:191)
12-12 12:54:38.671: E/AndroidRuntime(11329): at android.widget.ExpandableListConnector.getItemId(ExpandableListConnector.java:422)
12-12 12:54:38.671: E/AndroidRuntime(11329): at android.widget.AbsListView.obtainView(AbsListView.java:2180)
12-12 12:54:38.671: E/AndroidRuntime(11329): at android.widget.ListView.measureHeightOfChildren(ListView.java:1246)
12-12 12:54:38.671: E/AndroidRuntime(11329): at android.widget.ListView.onMeasure(ListView.java:1158)
12-12 12:54:38.671: E/AndroidRuntime(11329): at android.view.View.measure(View.java:15525)
12-12 12:54:38.671: E/AndroidRuntime(11329): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4825)
12-12 12:54:38.671: E/AndroidRuntime(11329): at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1404)
12-12 12:54:38.671: E/AndroidRuntime(11329): at android.widget.LinearLayout.measureVertical(LinearLayout.java:695)
12-12 12:54:38.671: E/AndroidRuntime(11329): at android.widget.LinearLayout.onMeasure(LinearLayout.java:588)
12-12 12:54:38.671: E/AndroidRuntime(11329): at android.view.View.measure(View.java:15525)
12-12 12:54:38.671: E/AndroidRuntime(11329): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4825)
12-12 12:54:38.671: E/AndroidRuntime(11329): at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
12-12 12:54:38.671: E/AndroidRuntime(11329): at android.view.View.measure(View.java:15525)
12-12 12:54:38.671: E/AndroidRuntime(11329): at android.support.v4.view.ViewPager.onMeasure(ViewPager.java:1447)
12-12 12:54:38.671: E/AndroidRuntime(11329): at android.view.View.measure(View.java:15525)
12-12 12:54:38.671: E/AndroidRuntime(11329): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4825)
12-12 12:54:38.671: E/AndroidRuntime(11329): at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
12-12 12:54:38.671: E/AndroidRuntime(11329): at android.view.View.measure(View.java:15525)
12-12 12:54:38.671: E/AndroidRuntime(11329): at android.widget.LinearLayout.measureVertical(LinearLayout.java:847)
12-12 12:54:38.671: E/AndroidRuntime(11329): at android.widget.LinearLayout.onMeasure(LinearLayout.java:588)
12-12 12:54:38.671: E/AndroidRuntime(11329): at android.view.View.measure(View.java:15525)
12-12 12:54:38.671: E/AndroidRuntime(11329): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4825)
12-12 12:54:38.671: E/AndroidRuntime(11329): at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
12-12 12:54:38.671: E/AndroidRuntime(11329): at com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2438)
12-12 12:54:38.671: E/AndroidRuntime(11329): at android.view.View.measure(View.java:15525)
12-12 12:54:38.671: E/AndroidRuntime(11329): at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:1874)
12-12 12:54:38.671: E/AndroidRuntime(11329): at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1089)
12-12 12:54:38.671: E/AndroidRuntime(11329): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1265)
12-12 12:54:38.671: E/AndroidRuntime(11329): at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:989)
12-12 12:54:38.671: E/AndroidRuntime(11329): at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4351)
12-12 12:54:38.671: E/AndroidRuntime(11329): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:749)
12-12 12:54:38.671: E/AndroidRuntime(11329): at android.view.Choreographer.doCallbacks(Choreographer.java:562)
12-12 12:54:38.671: E/AndroidRuntime(11329): at android.view.Choreographer.doFrame(Choreographer.java:532)
12-12 12:54:38.671: E/AndroidRuntime(11329): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:735)
12-12 12:54:38.671: E/AndroidRuntime(11329): at android.os.Handler.handleCallback(Handler.java:725)
12-12 12:54:38.671: E/AndroidRuntime(11329): at android.os.Handler.dispatchMessage(Handler.java:92)
12-12 12:54:38.671: E/AndroidRuntime(11329): at android.os.Looper.loop(Looper.java:137)
12-12 12:54:38.671: E/AndroidRuntime(11329): at android.app.ActivityThread.main(ActivityThread.java:5227)
12-12 12:54:38.671: E/AndroidRuntime(11329): at java.lang.reflect.Method.invokeNative(Native Method)
12-12 12:54:38.671: E/AndroidRuntime(11329): at java.lang.reflect.Method.invoke(Method.java:511)
12-12 12:54:38.671: E/AndroidRuntime(11329): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:795)
12-12 12:54:38.671: E/AndroidRuntime(11329): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:562)
12-12 12:54:38.671: E/AndroidRuntime(11329): at dalvik.system.NativeStart.main(Native Method)
Anyway on an older device the header appears as intended. but throws a similar stacktrace when clicking the header. So my guess is that the newer phones tried to expand the Group for me without having to actually click it.
01-03 21:48:06.656: E/CursorWindow(16844): Bad request for field slot 0,-1. numRows = 1, numColumns = 2
01-03 21:48:06.656: W/dalvikvm(16844): threadid=1: thread exiting with uncaught exception (group=0x40018578)
01-03 21:48:06.664: E/AndroidRuntime(16844): FATAL EXCEPTION: main
01-03 21:48:06.664: E/AndroidRuntime(16844): java.lang.IllegalStateException: get field slot from row 0 col -1 failed
01-03 21:48:06.664: E/AndroidRuntime(16844): at android.database.CursorWindow.getLong_native(Native Method)
01-03 21:48:06.664: E/AndroidRuntime(16844): at android.database.CursorWindow.getLong(CursorWindow.java:412)
01-03 21:48:06.664: E/AndroidRuntime(16844): at android.database.AbstractWindowedCursor.getLong(AbstractWindowedCursor.java:108)
01-03 21:48:06.664: E/AndroidRuntime(16844): at android.widget.CursorTreeAdapter$MyCursorHelper.getId(CursorTreeAdapter.java:437)
01-03 21:48:06.664: E/AndroidRuntime(16844): at android.widget.CursorTreeAdapter.getGroupId(CursorTreeAdapter.java:192)
01-03 21:48:06.664: E/AndroidRuntime(16844): at android.widget.ExpandableListConnector.getItemId(ExpandableListConnector.java:421)
01-03 21:48:06.664: E/AndroidRuntime(16844): at android.widget.AdapterView.getItemIdAtPosition(AdapterView.java:745)
01-03 21:48:06.664: E/AndroidRuntime(16844): at android.widget.AdapterView.setSelectedPositionInt(AdapterView.java:1088)
01-03 21:48:06.664: E/AndroidRuntime(16844): at android.widget.AbsListView.onTouchEvent(AbsListView.java:2744)
01-03 21:48:06.664: E/AndroidRuntime(16844): at android.widget.ListView.onTouchEvent(ListView.java:3669)
01-03 21:48:06.664: E/AndroidRuntime(16844): at android.view.View.dispatchTouchEvent(View.java:3885)
01-03 21:48:06.664: E/AndroidRuntime(16844): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:903)
01-03 21:48:06.664: E/AndroidRuntime(16844): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:942)
01-03 21:48:06.664: E/AndroidRuntime(16844): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:942)
01-03 21:48:06.664: E/AndroidRuntime(16844): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:942)
01-03 21:48:06.664: E/AndroidRuntime(16844): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:942)
01-03 21:48:06.664: E/AndroidRuntime(16844): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:942)
01-03 21:48:06.664: E/AndroidRuntime(16844): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:942)
01-03 21:48:06.664: E/AndroidRuntime(16844): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:942)
01-03 21:48:06.664: E/AndroidRuntime(16844): at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1769)
01-03 21:48:06.664: E/AndroidRuntime(16844): at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1135)
01-03 21:48:06.664: E/AndroidRuntime(16844): at android.app.Activity.dispatchTouchEvent(Activity.java:2096)
01-03 21:48:06.664: E/AndroidRuntime(16844): at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1753)
01-03 21:48:06.664: E/AndroidRuntime(16844): at android.view.ViewRoot.deliverPointerEvent(ViewRoot.java:2227)
01-03 21:48:06.664: E/AndroidRuntime(16844): at android.view.ViewRoot.handleMessage(ViewRoot.java:1886)
01-03 21:48:06.664: E/AndroidRuntime(16844): at android.os.Handler.dispatchMessage(Handler.java:99)
01-03 21:48:06.664: E/AndroidRuntime(16844): at android.os.Looper.loop(Looper.java:130)
01-03 21:48:06.664: E/AndroidRuntime(16844): at android.app.ActivityThread.main(ActivityThread.java:3687)
01-03 21:48:06.664: E/AndroidRuntime(16844): at java.lang.reflect.Method.invokeNative(Native Method)
01-03 21:48:06.664: E/AndroidRuntime(16844): at java.lang.reflect.Method.invoke(Method.java:507)
01-03 21:48:06.664: E/AndroidRuntime(16844): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
01-03 21:48:06.664: E/AndroidRuntime(16844): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:625)
01-03 21:48:06.664: E/AndroidRuntime(16844): at dalvik.system.NativeStart.main(Native Method)
I have Checked other similar problems but there was at least one point at which the Stacktrace refereed to the actual workspace. But in this case i have no idea what i going on. All i can tell is that the getChildrenCursor of the CursorTreeAdapter has not been called at the point the app crashes because i added a println to the methods body.
And this is how i setup the group cursor, im not calling movetoFirst as thats supposed to managed by the CursorTreeAdapter and appears to work since it displays on header with proper content.
public Cursor getGroupCursor(){
SQLiteDatabase db = helper.getReadableDatabase();
String sqlQuery = "SELECT DISTINCT STRFTIME('%m', " + INTAKE_KEY_DATE
+ ") as month, STRFTIME('%Y', " + INTAKE_KEY_DATE + ") as year " +
"FROM " + TABLENAME_INTAKE;
return db.rawQuery(sqlQuery, null);
}
If you need any additional code, let me know
Found it,
The documentation states that every table has to have a column named _id, which mine doesnt. at least for now :)
public class MainActivity extends FragmentActivity {
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
Manifest file
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.map.googlemapv2"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="18" />
<permission
android:name="com.map.googlemapv2.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<!--
The following two permissions are not required to use
Google Maps Android API v2, but are recommended.
-->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="com.map.googlemapv2.permission.MAPS_RECEIVE" />
<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.map.googlemapv2.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>
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyXXXXXXXXXXXXXXXXXXXXXXXX" />
</application>
</manifest>
Layout File
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity" >
<fragment
android:id="#+id/map"
android:name="com.google.android.gms.maps.MapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="#+id/btnSurrey" />
</RelativeLayout>
StackTrace :
12-12 06:19:45.460: D/AndroidRuntime(907): Shutting down VM
12-12 06:19:45.460: W/dalvikvm(907): threadid=1: thread exiting with uncaught exception (group=0xb4aeab90)
12-12 06:19:45.500: E/AndroidRuntime(907): FATAL EXCEPTION: main
12-12 06:19:45.500: E/AndroidRuntime(907): Process: com.amaps.androidmap, PID: 907
12-12 06:19:45.500: E/AndroidRuntime(907): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.amaps.androidmap/com.amaps.androidmap.MainActivity}: android.view.InflateException: Binary XML file line #2: Error inflating class fragment
12-12 06:19:45.500: E/AndroidRuntime(907): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2176)
12-12 06:19:45.500: E/AndroidRuntime(907): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2226)
12-12 06:19:45.500: E/AndroidRuntime(907): at android.app.ActivityThread.access$700(ActivityThread.java:135)
12-12 06:19:45.500: E/AndroidRuntime(907): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1397)
12-12 06:19:45.500: E/AndroidRuntime(907): at android.os.Handler.dispatchMessage(Handler.java:102)
12-12 06:19:45.500: E/AndroidRuntime(907): at android.os.Looper.loop(Looper.java:137)
12-12 06:19:45.500: E/AndroidRuntime(907): at android.app.ActivityThread.main(ActivityThread.java:4998)
12-12 06:19:45.500: E/AndroidRuntime(907): at java.lang.reflect.Method.invokeNative(Native Method)
12-12 06:19:45.500: E/AndroidRuntime(907): at java.lang.reflect.Method.invoke(Method.java:515)
12-12 06:19:45.500: E/AndroidRuntime(907): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:777)
12-12 06:19:45.500: E/AndroidRuntime(907): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:593)
12-12 06:19:45.500: E/AndroidRuntime(907): at dalvik.system.NativeStart.main(Native Method)
12-12 06:19:45.500: E/AndroidRuntime(907): Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class fragment
12-12 06:19:45.500: E/AndroidRuntime(907): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:713)
12-12 06:19:45.500: E/AndroidRuntime(907): at android.view.LayoutInflater.inflate(LayoutInflater.java:469)
12-12 06:19:45.500: E/AndroidRuntime(907): at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
12-12 06:19:45.500: E/AndroidRuntime(907): at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
12-12 06:19:45.500: E/AndroidRuntime(907): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:290)
12-12 06:19:45.500: E/AndroidRuntime(907): at android.app.Activity.setContentView(Activity.java:1928)
12-12 06:19:45.500: E/AndroidRuntime(907): at com.amaps.androidmap.MainActivity.onCreate(MainActivity.java:12)
12-12 06:19:45.500: E/AndroidRuntime(907): at android.app.Activity.performCreate(Activity.java:5243)
12-12 06:19:45.500: E/AndroidRuntime(907): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
12-12 06:19:45.500: E/AndroidRuntime(907): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2140)
12-12 06:19:45.500: E/AndroidRuntime(907): ... 11 more
12-12 06:19:45.500: E/AndroidRuntime(907): Caused by: android.app.Fragment$InstantiationException: Unable to instantiate fragment com.google.android.gms.maps.MapFragment: make sure class name exists, is public, and has an empty constructor that is public
12-12 06:19:45.500: E/AndroidRuntime(907): at android.app.Fragment.instantiate(Fragment.java:597)
12-12 06:19:45.500: E/AndroidRuntime(907): at android.app.Fragment.instantiate(Fragment.java:561)
12-12 06:19:45.500: E/AndroidRuntime(907): at android.app.Activity.onCreateView(Activity.java:4777)
12-12 06:19:45.500: E/AndroidRuntime(907): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:689)
12-12 06:19:45.500: E/AndroidRuntime(907): ... 20 more
12-12 06:19:45.500: E/AndroidRuntime(907): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.maps.MapFragment" on path: DexPathList[[zip file "/data/app/com.amaps.androidmap-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.amaps.androidmap-2, /system/lib]]
12-12 06:19:45.500: E/AndroidRuntime(907): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
12-12 06:19:45.500: E/AndroidRuntime(907): at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
12-12 06:19:45.500: E/AndroidRuntime(907): at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
12-12 06:19:45.500: E/AndroidRuntime(907): at android.app.Fragment.instantiate(Fragment.java:583)
12-12 06:19:45.500: E/AndroidRuntime(907): ... 23 more
12-12 06:23:20.842: I/Process(907): Sending signal. PID: 907 SIG: 9
12-12 06:44:02.832: D/AndroidRuntime(1054): Shutting down VM
12-12 06:44:02.832: W/dalvikvm(1054): threadid=1: thread exiting with uncaught exception (group=0xb4aeab90)
12-12 06:44:02.852: E/AndroidRuntime(1054): FATAL EXCEPTION: main
12-12 06:44:02.852: E/AndroidRuntime(1054): Process: com.amaps.androidmap, PID: 1054
12-12 06:44:02.852: E/AndroidRuntime(1054): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.amaps.androidmap/com.amaps.androidmap.MainActivity}: android.view.InflateException: Binary XML file line #7: Error inflating class fragment
12-12 06:44:02.852: E/AndroidRuntime(1054): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2176)
12-12 06:44:02.852: E/AndroidRuntime(1054): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2226)
12-12 06:44:02.852: E/AndroidRuntime(1054): at android.app.ActivityThread.access$700(ActivityThread.java:135)
12-12 06:44:02.852: E/AndroidRuntime(1054): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1397)
12-12 06:44:02.852: E/AndroidRuntime(1054): at android.os.Handler.dispatchMessage(Handler.java:102)
12-12 06:44:02.852: E/AndroidRuntime(1054): at android.os.Looper.loop(Looper.java:137)
12-12 06:44:02.852: E/AndroidRuntime(1054): at android.app.ActivityThread.main(ActivityThread.java:4998)
12-12 06:44:02.852: E/AndroidRuntime(1054): at java.lang.reflect.Method.invokeNative(Native Method)
12-12 06:44:02.852: E/AndroidRuntime(1054): at java.lang.reflect.Method.invoke(Method.java:515)
12-12 06:44:02.852: E/AndroidRuntime(1054): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:777)
12-12 06:44:02.852: E/AndroidRuntime(1054): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:593)
12-12 06:44:02.852: E/AndroidRuntime(1054): at dalvik.system.NativeStart.main(Native Method)
12-12 06:44:02.852: E/AndroidRuntime(1054): Caused by: android.view.InflateException: Binary XML file line #7: Error inflating class fragment
12-12 06:44:02.852: E/AndroidRuntime(1054): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:713)
12-12 06:44:02.852: E/AndroidRuntime(1054): at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
12-12 06:44:02.852: E/AndroidRuntime(1054): at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
12-12 06:44:02.852: E/AndroidRuntime(1054): at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
12-12 06:44:02.852: E/AndroidRuntime(1054): at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
12-12 06:44:02.852: E/AndroidRuntime(1054): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:290)
12-12 06:44:02.852: E/AndroidRuntime(1054): at android.app.Activity.setContentView(Activity.java:1928)
12-12 06:44:02.852: E/AndroidRuntime(1054): at com.amaps.androidmap.MainActivity.onCreate(MainActivity.java:12)
12-12 06:44:02.852: E/AndroidRuntime(1054): at android.app.Activity.performCreate(Activity.java:5243)
12-12 06:44:02.852: E/AndroidRuntime(1054): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
12-12 06:44:02.852: E/AndroidRuntime(1054): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2140)
12-12 06:44:02.852: E/AndroidRuntime(1054): ... 11 more
12-12 06:44:02.852: E/AndroidRuntime(1054): Caused by: android.app.Fragment$InstantiationException: Unable to instantiate fragment com.google.android.gms.maps.SupportMapFragment: make sure class name exists, is public, and has an empty constructor that is public
12-12 06:44:02.852: E/AndroidRuntime(1054): at android.app.Fragment.instantiate(Fragment.java:597)
12-12 06:44:02.852: E/AndroidRuntime(1054): at android.app.Fragment.instantiate(Fragment.java:561)
12-12 06:44:02.852: E/AndroidRuntime(1054): at android.app.Activity.onCreateView(Activity.java:4777)
12-12 06:44:02.852: E/AndroidRuntime(1054): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:689)
12-12 06:44:02.852: E/AndroidRuntime(1054): ... 21 more
12-12 06:44:02.852: E/AndroidRuntime(1054): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.maps.SupportMapFragment" on path: DexPathList[[zip file "/data/app/com.amaps.androidmap-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.amaps.androidmap-1, /system/lib]]
12-12 06:44:02.852: E/AndroidRuntime(1054): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
12-12 06:44:02.852: E/AndroidRuntime(1054): at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
12-12 06:44:02.852: E/AndroidRuntime(1054): at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
12-12 06:44:02.852: E/AndroidRuntime(1054): at android.app.Fragment.instantiate(Fragment.java:583)
12-12 06:44:02.852: E/AndroidRuntime(1054): ... 24 more
12-12 06:49:03.212: I/Process(1054): Sending signal. PID: 1054 SIG: 9
12-12 06:58:53.742: D/AndroidRuntime(1100): Shutting down VM
12-12 06:58:53.742: W/dalvikvm(1100): threadid=1: thread exiting with uncaught exception (group=0xb4aeab90)
12-12 06:58:53.762: E/AndroidRuntime(1100): FATAL EXCEPTION: main
12-12 06:58:53.762: E/AndroidRuntime(1100): Process: com.amaps.androidmap, PID: 1100
12-12 06:58:53.762: E/AndroidRuntime(1100): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.amaps.androidmap/com.amaps.androidmap.MainActivity}: android.view.InflateException: Binary XML file line #7: Error inflating class fragment
12-12 06:58:53.762: E/AndroidRuntime(1100): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2176)
12-12 06:58:53.762: E/AndroidRuntime(1100): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2226)
12-12 06:58:53.762: E/AndroidRuntime(1100): at android.app.ActivityThread.access$700(ActivityThread.java:135)
12-12 06:58:53.762: E/AndroidRuntime(1100): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1397)
12-12 06:58:53.762: E/AndroidRuntime(1100): at android.os.Handler.dispatchMessage(Handler.java:102)
12-12 06:58:53.762: E/AndroidRuntime(1100): at android.os.Looper.loop(Looper.java:137)
12-12 06:58:53.762: E/AndroidRuntime(1100): at android.app.ActivityThread.main(ActivityThread.java:4998)
12-12 06:58:53.762: E/AndroidRuntime(1100): at java.lang.reflect.Method.invokeNative(Native Method)
12-12 06:58:53.762: E/AndroidRuntime(1100): at java.lang.reflect.Method.invoke(Method.java:515)
12-12 06:58:53.762: E/AndroidRuntime(1100): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:777)
12-12 06:58:53.762: E/AndroidRuntime(1100): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:593)
12-12 06:58:53.762: E/AndroidRuntime(1100): at dalvik.system.NativeStart.main(Native Method)
12-12 06:58:53.762: E/AndroidRuntime(1100): Caused by: android.view.InflateException: Binary XML file line #7: Error inflating class fragment
12-12 06:58:53.762: E/AndroidRuntime(1100): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:713)
12-12 06:58:53.762: E/AndroidRuntime(1100): at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
12-12 06:58:53.762: E/AndroidRuntime(1100): at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
12-12 06:58:53.762: E/AndroidRuntime(1100): at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
12-12 06:58:53.762: E/AndroidRuntime(1100): at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
12-12 06:58:53.762: E/AndroidRuntime(1100): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:290)
12-12 06:58:53.762: E/AndroidRuntime(1100): at android.app.Activity.setContentView(Activity.java:1928)
12-12 06:58:53.762: E/AndroidRuntime(1100): at com.amaps.androidmap.MainActivity.onCreate(MainActivity.java:12)
12-12 06:58:53.762: E/AndroidRuntime(1100): at android.app.Activity.performCreate(Activity.java:5243)
12-12 06:58:53.762: E/AndroidRuntime(1100): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
12-12 06:58:53.762: E/AndroidRuntime(1100): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2140)
12-12 06:58:53.762: E/AndroidRuntime(1100): ... 11 more
12-12 06:58:53.762: E/AndroidRuntime(1100): Caused by: android.app.Fragment$InstantiationException: Unable to instantiate fragment com.google.android.gms.maps.SupportMapFragment: make sure class name exists, is public, and has an empty constructor that is public
12-12 06:58:53.762: E/AndroidRuntime(1100): at android.app.Fragment.instantiate(Fragment.java:597)
12-12 06:58:53.762: E/AndroidRuntime(1100): at android.app.Fragment.instantiate(Fragment.java:561)
12-12 06:58:53.762: E/AndroidRuntime(1100): at android.app.Activity.onCreateView(Activity.java:4777)
12-12 06:58:53.762: E/AndroidRuntime(1100): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:689)
12-12 06:58:53.762: E/AndroidRuntime(1100): ... 21 more
12-12 06:58:53.762: E/AndroidRuntime(1100): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.maps.SupportMapFragment" on path: DexPathList[[zip file "/data/app/com.amaps.androidmap-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.amaps.androidmap-2, /system/lib]]
12-12 06:58:53.762: E/AndroidRuntime(1100): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
12-12 06:58:53.762: E/AndroidRuntime(1100): at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
12-12 06:58:53.762: E/AndroidRuntime(1100): at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
12-12 06:58:53.762: E/AndroidRuntime(1100): at android.app.Fragment.instantiate(Fragment.java:583)
12-12 06:58:53.762: E/AndroidRuntime(1100): ... 24 more
12-12 06:59:41.712: I/Process(1100): Sending signal. PID: 1100 SIG: 9
i import the library from path :
adt-bundle-linux-x86-20131030/sdk/extras/google/google_play_services/libproject//google-play-services_lib/
i also made the reference but still nothing happen.Dont knw what to do.
I suspect that you have not referenced to the google play services library project properly. Make sure you do that first.
<uses-sdk
android:minSdkVersion="8"
Your min sdk is 8. Use SupportMapFragment and extend FragmentActivity and use support library.
or change to api level to 12 and above.
You are also missing
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
in Application Tag of manifest
https://developers.google.com/maps/documentation/android/start#getting_the_google_maps_android_api_v2
Make sure you have referenced google play services library project properly and followed all the steps in the above link
Replace it:
<fragment
android:id="#+id/map"
android:name="com.google.android.gms.maps.MapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="#+id/btnSurrey" />
with this:
<?xml version="1.0" encoding="utf-8"?>
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:name="com.google.android.gms.maps.SupportMapFragment"/>
add this in maifest:
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
Your MapFragment should be defined like this.
<fragment
android:id="#+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
class="com.google.android.gms.maps.MapFragment" />
Add this in AndroidManifest.xml
<meta-data android:name="com.google.android.gms.version" android:value="#integer/google_play_services_version" />
In my app there are no compilation errors when i tried to run my app on android device it shows App stopped unexpectedly error .i didn't find the exact problem in lohcat here i am pasting the logcat details any one please exaplain this.
12-12 00:39:20.240: I/dalvikvm(687): Could not find method com.google.inject.Injector.getInstance, referenced from method de.dan_nrw.android.scroid.DependencyInjector.getInstance
12-12 00:39:20.310: W/dalvikvm(687): VFY: unable to resolve interface method 3344: Lcom/google/inject/Injector;.getInstance (Ljava/lang/Class;)Ljava/lang/Object;
12-12 00:39:20.310: D/dalvikvm(687): VFY: replacing opcode 0x72 at 0x000e
12-12 00:39:20.320: E/dalvikvm(687): Could not find class 'com.google.inject.Module[]', referenced from method de.dan_nrw.android.scroid.DependencyInjector.init
12-12 00:39:20.370: W/dalvikvm(687): VFY: unable to resolve new-array 684 ([Lcom/google/inject/Module;) in Lde/dan_nrw/android/scroid/DependencyInjector;
12-12 00:39:20.370: D/dalvikvm(687): VFY: replacing opcode 0x23 at 0x0001
12-12 00:39:20.413: W/dalvikvm(687): Unable to resolve superclass of Lde/dan_nrw/android/scroid/ProductiveModule; (472)
12-12 00:39:20.450: W/dalvikvm(687): Link of class 'Lde/dan_nrw/android/scroid/ProductiveModule;' failed
12-12 00:39:20.450: D/dalvikvm(687): DexOpt: unable to opt direct call 0x0d30 at 0x06 in Lde/dan_nrw/android/scroid/DependencyInjector;.init
12-12 00:39:20.471: D/AndroidRuntime(687): Shutting down VM
12-12 00:39:20.471: W/dalvikvm(687): threadid=1: thread exiting with uncaught exception (group=0x409961f8)
12-12 00:39:20.511: E/AndroidRuntime(687): FATAL EXCEPTION: main
12-12 00:39:20.511: E/AndroidRuntime(687): java.lang.NoClassDefFoundError: com.google.inject.Module[]
12-12 00:39:20.511: E/AndroidRuntime(687): at de.dan_nrw.android.scroid.DependencyInjector.init(DependencyInjector.java:37)
12-12 00:39:20.511: E/AndroidRuntime(687): at de.dan_nrw.android.scroid.ScroidWallpaperGallery.<init>(ScroidWallpaperGallery.java:84)
12-12 00:39:20.511: E/AndroidRuntime(687): at java.lang.Class.newInstanceImpl(Native Method)
12-12 00:39:20.511: E/AndroidRuntime(687): at java.lang.Class.newInstance(Class.java:1319)
12-12 00:39:20.511: E/AndroidRuntime(687): at android.app.Instrumentation.newActivity(Instrumentation.java:1023)
12-12 00:39:20.511: E/AndroidRuntime(687): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1870)
12-12 00:39:20.511: E/AndroidRuntime(687): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1980)
12-12 00:39:20.511: E/AndroidRuntime(687): at android.app.ActivityThread.access$600(ActivityThread.java:122)
12-12 00:39:20.511: E/AndroidRuntime(687): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1146)
12-12 00:39:20.511: E/AndroidRuntime(687): at android.os.Handler.dispatchMessage(Handler.java:99)
12-12 00:39:20.511: E/AndroidRuntime(687): at android.os.Looper.loop(Looper.java:137)
12-12 00:39:20.511: E/AndroidRuntime(687): at android.app.ActivityThread.main(ActivityThread.java:4340)
12-12 00:39:20.511: E/AndroidRuntime(687): at java.lang.reflect.Method.invokeNative(Native Method)
12-12 00:39:20.511: E/AndroidRuntime(687): at java.lang.reflect.Method.invoke(Method.java:511)
12-12 00:39:20.511: E/AndroidRuntime(687): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
12-12 00:39:20.511: E/AndroidRuntime(687): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
12-12 00:39:20.511: E/AndroidRuntime(687): at dalvik.system.NativeStart.main(Native Method)
12-12 00:39:23.931: I/Process(687): Sending signal. PID: 687 SIG: 9
12-12 00:44:23.441: I/dalvikvm(728): Could not find method com.google.inject.Injector.getInstance, referenced from method de.dan_nrw.android.scroid.DependencyInjector.getInstance
12-12 00:44:23.491: W/dalvikvm(728): VFY: unable to resolve interface method 3344: Lcom/google/inject/Injector;.getInstance (Ljava/lang/Class;)Ljava/lang/Object;
12-12 00:44:23.491: D/dalvikvm(728): VFY: replacing opcode 0x72 at 0x000e
12-12 00:44:23.491: E/dalvikvm(728): Could not find class 'com.google.inject.Module[]', referenced from method de.dan_nrw.android.scroid.DependencyInjector.init
12-12 00:44:23.491: W/dalvikvm(728): VFY: unable to resolve new-array 684 ([Lcom/google/inject/Module;) in Lde/dan_nrw/android/scroid/DependencyInjector;
12-12 00:44:23.491: D/dalvikvm(728): VFY: replacing opcode 0x23 at 0x0001
12-12 00:44:23.511: W/dalvikvm(728): Unable to resolve superclass of Lde/dan_nrw/android/scroid/ProductiveModule; (472)
12-12 00:44:23.521: W/dalvikvm(728): Link of class 'Lde/dan_nrw/android/scroid/ProductiveModule;' failed
12-12 00:44:23.551: D/dalvikvm(728): DexOpt: unable to opt direct call 0x0d30 at 0x06 in Lde/dan_nrw/android/scroid/DependencyInjector;.init
12-12 00:44:23.551: D/AndroidRuntime(728): Shutting down VM
12-12 00:44:23.561: W/dalvikvm(728): threadid=1: thread exiting with uncaught exception (group=0x409961f8)
12-12 00:44:23.641: E/AndroidRuntime(728): FATAL EXCEPTION: main
12-12 00:44:23.641: E/AndroidRuntime(728): java.lang.NoClassDefFoundError: com.google.inject.Module[]
12-12 00:44:23.641: E/AndroidRuntime(728): at de.dan_nrw.android.scroid.DependencyInjector.init(DependencyInjector.java:37)
12-12 00:44:23.641: E/AndroidRuntime(728): at de.dan_nrw.android.scroid.ScroidWallpaperGallery.<init>(ScroidWallpaperGallery.java:84)
12-12 00:44:23.641: E/AndroidRuntime(728): at java.lang.Class.newInstanceImpl(Native Method)
12-12 00:44:23.641: E/AndroidRuntime(728): at java.lang.Class.newInstance(Class.java:1319)
12-12 00:44:23.641: E/AndroidRuntime(728): at android.app.Instrumentation.newActivity(Instrumentation.java:1023)
12-12 00:44:23.641: E/AndroidRuntime(728): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1870)
12-12 00:44:23.641: E/AndroidRuntime(728): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1980)
12-12 00:44:23.641: E/AndroidRuntime(728): at android.app.ActivityThread.access$600(ActivityThread.java:122)
12-12 00:44:23.641: E/AndroidRuntime(728): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1146)
12-12 00:44:23.641: E/AndroidRuntime(728): at android.os.Handler.dispatchMessage(Handler.java:99)
12-12 00:44:23.641: E/AndroidRuntime(728): at android.os.Looper.loop(Looper.java:137)
12-12 00:44:23.641: E/AndroidRuntime(728): at android.app.ActivityThread.main(ActivityThread.java:4340)
12-12 00:44:23.641: E/AndroidRuntime(728): at java.lang.reflect.Method.invokeNative(Native Method)
12-12 00:44:23.641: E/AndroidRuntime(728): at java.lang.reflect.Method.invoke(Method.java:511)
12-12 00:44:23.641: E/AndroidRuntime(728): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
12-12 00:44:23.641: E/AndroidRuntime(728): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
12-12 00:44:23.641: E/AndroidRuntime(728): at dalvik.system.NativeStart.main(Native Method)
It could be you forgot to add a necessary jar to the build path
I having trouble accessing to strings.xml:
Log.i("url",context.getString(R.string.url));
in strings.xml
<string name="url">http://myip.com/</string>
It generates a exception:
12-12 14:52:44.551: E/AndroidRuntime(3534): FATAL EXCEPTION: WebViewCoreThread
12-12 14:52:44.551: E/AndroidRuntime(3534): java.lang.NullPointerException
12-12 14:52:44.551: E/AndroidRuntime(3534): at com.usualbike.cbike.NewIncidence.noRegInsertData(NewIncidence.java:70)
12-12 14:52:44.551: E/AndroidRuntime(3534): at com.usualbike.cbike.IncidenceData$MyJavaScriptInterface.enviarIncidencia(IncidenceData.java:163)
12-12 14:52:44.551: E/AndroidRuntime(3534): at android.webkit.WebViewCore.nativeTouchUp(Native Method)
12-12 14:52:44.551: E/AndroidRuntime(3534): at android.webkit.WebViewCore.nativeTouchUp(Native Method)
12-12 14:52:44.551: E/AndroidRuntime(3534): at android.webkit.WebViewCore.access$3300(WebViewCore.java:52)
12-12 14:52:44.551: E/AndroidRuntime(3534): at android.webkit.WebViewCore$EventHub$1.handleMessage(WebViewCore.java:1150)
12-12 14:52:44.551: E/AndroidRuntime(3534): at android.os.Handler.dispatchMessage(Handler.java:99)
12-12 14:52:44.551: E/AndroidRuntime(3534): at android.os.Looper.loop(Looper.java:123)
12-12 14:52:44.551: E/AndroidRuntime(3534): at android.webkit.WebViewCore$WebCoreThread.run(WebViewCore.java:621)
12-12 14:52:44.551: E/AndroidRuntime(3534): at java.lang.Thread.run(Thread.java:1096)
try as to get String from Strings.xml
String strurl=context.getresources().getString(R.string.url);
Log.i("url ",strurl);
context is null, apparently, if you are getting a NullPointerException on that line.
I am trying to clear a webview from the view in my application.
I clear this by using: MyWebView.loadUrl("about:blank");
This works sometimes, but other times when I load the emulator this gives a force close error:
03-18 14:58:29.560: ERROR/AndroidRuntime(380): FATAL EXCEPTION: main
03-18 14:58:29.560: ERROR/AndroidRuntime(380): java.lang.NullPointerException
03-18 14:58:29.560: ERROR/AndroidRuntime(380): at com.edu.WordJumbleMain$5.onClick(WordJumbleMain.java:168)
03-18 14:58:29.560: ERROR/AndroidRuntime(380): at android.view.View.performClick(View.java:2408)
03-18 14:58:29.560: ERROR/AndroidRuntime(380): at android.view.View$PerformClick.run(View.java:8816)
03-18 14:58:29.560: ERROR/AndroidRuntime(380): at android.os.Handler.handleCallback(Handler.java:587)
03-18 14:58:29.560: ERROR/AndroidRuntime(380): at android.os.Handler.dispatchMessage(Handler.java:92)
03-18 14:58:29.560: ERROR/AndroidRuntime(380): at android.os.Looper.loop(Looper.java:123)
03-18 14:58:29.560: ERROR/AndroidRuntime(380): at android.app.ActivityThread.main(ActivityThread.java:4627)
03-18 14:58:29.560: ERROR/AndroidRuntime(380): at java.lang.reflect.Method.invokeNative(Native Method)
03-18 14:58:29.560: ERROR/AndroidRuntime(380): at java.lang.reflect.Method.invoke(Method.java:521)
03-18 14:58:29.560: ERROR/AndroidRuntime(380): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
03-18 14:58:29.560: ERROR/AndroidRuntime(380): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
03-18 14:58:29.560: ERROR/AndroidRuntime(380): at dalvik.system.NativeStart.main(Native Method)
Is there any other way to clear the webview from the view.
Thanks
Raj,
Perhaps you simply want to use the clearView() method?
how to hide the "Web Page not available" text when web View fails to load the page. MyWebView.clearView() is not working.