Disable WebView touch events in Android

mWebView.setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { return true; } }); Disables all touch events on a WebView because the touch listener is executed before the default touch behavior of the WebView. By returning true the event is consumed and isn’t propagated to the WebView. Using android:clickable=”false” does not disable touch … Read more

Android HttpClient and HTTPS

This should get you started. I’m using basically the same, except with ThreadSafeClientConnManager. SchemeRegistry schemeRegistry = new SchemeRegistry(); schemeRegistry.register(new Scheme(“https”, SSLSocketFactory.getSocketFactory(), 443)); HttpParams params = new BasicHttpParams(); SingleClientConnManager mgr = new SingleClientConnManager(params, schemeRegistry); HttpClient client = new DefaultHttpClient(mgr, params);

Get the field value with a Cursor

I think you can forget about checking for null. Instead check if there is data and then access the columns using the cursor: Cursor cursor = fetchOption(0); if (cursor.moveToFirst()) // data? System.out.println(cursor.getString(cursor.getColumnIndex(“title”)); cursor.close(); // that’s important too, otherwise you’re gonna leak cursors It might also make sense to read an Android tutorial. The notepad tutorial … Read more

Black screen before Splash screen appear in android

Add a theme with the background you are using to your application tag in the manifest file to prevent the black screen to be drawn. theme.xml <resources> <!– Base application theme is the default theme. –> <style name=”Theme” parent=”android:style/Theme” /> <style name=”Theme.MyAppTheme” parent=”Theme”> <item name=”android:windowNoTitle”>true</item> <item name=”android:windowContentOverlay”>@null</item> <item name=”android:windowBackground”>@drawable/my_app_background</item> </style> </resources> AndroidManifest.xml …. <application android:name=”@string/app_name” … Read more