class not found exception in android - android

I am using following code for SQLConnection in android:
public void queryResultSet(String CommandSQL) throws ClassNotFoundException, java.sql.SQLException
{
ResultSet rs;
Connection conn = null;
Toast msg1 = Toast.makeText(getBaseContext(),
"Name = " + CommandSQL, Toast.LENGTH_LONG);
msg1.show();
Class.forName("net.sourceforge.jtds.jdbc.Driver");
String username="14Graficali\\Administrator";
String ConnUrl="jdbc:jtds:sqlserver://14GRAFICALI\\MSSQLSERVER2008;DatabaseName=DVDKiosk;user=14Graficali\\Administrator;Instance=SQLExpress";
conn = DriverManager.getConnection(ConnUrl);
Statement st=conn.createStatement();
rs=st.executeQuery(CommandSQL);
while(rs.next())
{
Toast msg2 = Toast.makeText(getBaseContext(),
"Name = " + rs.getString("UserName"), Toast.LENGTH_LONG);
msg2.show();
}
}
I have included net.sourceforge.jtds.jdbc.Driver as we can see below :
Stack Trace:
08-20 10:57:42.087: W/System.err(400): java.lang.ClassNotFoundException: net.sourceforge.jtds.jdbc.Driver
08-20 10:57:42.087: W/System.err(400): at java.lang.Class.classForName(Native Method)
08-20 10:57:42.087: W/System.err(400): at java.lang.Class.forName(Class.java:234)
08-20 10:57:42.087: W/System.err(400): at java.lang.Class.forName(Class.java:181)
08-20 10:57:42.087: W/System.err(400): at com.example.registrationapp.Login.queryResultSet(Login.java:93)
08-20 10:57:42.087: W/System.err(400): at com.example.registrationapp.Login$1.onClick(Login.java:126)
08-20 10:57:42.087: W/System.err(400): at android.view.View.performClick(View.java:2485)
08-20 10:57:42.087: W/System.err(400): at android.view.View$PerformClick.run(View.java:9080)
08-20 10:57:42.087: W/System.err(400): at android.os.Handler.handleCallback(Handler.java:587)
08-20 10:57:42.087: W/System.err(400): at android.os.Handler.dispatchMessage(Handler.java:92)
08-20 10:57:42.098: W/System.err(400): at android.os.Looper.loop(Looper.java:123)
08-20 10:57:42.098: W/System.err(400): at android.app.ActivityThread.main(ActivityThread.java:3683)
08-20 10:57:42.098: W/System.err(400): at java.lang.reflect.Method.invokeNative(Native Method)
08-20 10:57:42.098: W/System.err(400): at java.lang.reflect.Method.invoke(Method.java:507)
08-20 10:57:42.098: W/System.err(400): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
08-20 10:57:42.098: W/System.err(400): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
08-20 10:57:42.098: W/System.err(400): at dalvik.system.NativeStart.main(Native Method)
08-20 10:57:42.098: W/System.err(400): Caused by: java.lang.NoClassDefFoundError: net.sourceforge.jtds.jdbc.Driver
08-20 10:57:42.107: W/System.err(400): ... 16 more
08-20 10:57:42.107: W/System.err(400): Caused by: java.lang.ClassNotFoundException: net.sourceforge.jtds.jdbc.Driver in loader dalvik.system.PathClassLoader[/data/app/com.example.registrationapp-1.apk]
08-20 10:57:42.107: W/System.err(400): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
08-20 10:57:42.107: W/System.err(400): at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
08-20 10:57:42.107: W/System.err(400): at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
Please help me.

If you have already added the jtds-1.2.5 driver, good. Otherwise:
Right click on the Project > Properties > Libraries Tab Add the jtds-1.2.5.jar file by clicking on "Add External JARs"
Next, in the Order and Export tab (Right next to Libraries in the Java Build Path window) check the box for jtds-1.2.5.jar (and any other external jars you might have).
This will export the .jar containing the driver with the .apk file.

If you use ProGuard, then your class may be dropped by it because it is used with reflection only. And if you don't, Android can still fail to load class for some reasons. Look at LogCat during your package installation.

right click on the project - properties - java build path - Order and export - tick Android private libraries and all the libraries that u added

Related

Fragment Tabhost Error: java.lang.IllegalStateException: No tab known for tag null When Internet Connection not available

I Am first checking the internet connection and after that I am starting my Activity and I face this problem when I use the Tab Host.
I am also put my adding tab host code in the try catch but it don't even catch the exception.
XML Code:
<android.support.v4.app.FragmentTabHost
android:id="#android:id/tabhost"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#999999"
>
<FrameLayout
android:id="#android:id/tabcontent"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_weight="0" />
</android.support.v4.app.FragmentTabHost>
My java Code
cd = new ConnectionDetector(Alumni_MainActivity.this);
// Check if Internet present
if (!cd.isConnectingToInternet()) {
// Internet Connection is not present
alert.showAlertDialog(Alumni_MainActivity.this,
"Internet Connection Error",
"Please connect to working Internet connection", false);
// stop executing code by return
return;
}
try {
tabHost = (FragmentTabHost) findViewById(android.R.id.tabhost);
tabHost.setup(this, getSupportFragmentManager(), R.id.fragment_container);
addTab("Chat", R.drawable.chaticon, ChatRoom.class, tabHost,null);
addTab("Contacts", R.drawable.contacticon, Memeber_view.class, tabHost, null);
addTab("Gallery", R.drawable.gallery, Galler_View.class, tabHost, null);
addTab("Event", R.drawable.event, EventList.class, tabHost,null);
addTab("More", R.drawable.moreicon, More.class, tabHost,null);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Error:
08-20 10:02:04.195: E/AndroidRuntime(13462): FATAL EXCEPTION: main
08-20 10:02:04.195: E/AndroidRuntime(13462): java.lang.IllegalStateException: No tab known for tag null
08-20 10:02:04.195: E/AndroidRuntime(13462): at android.support.v4.app.FragmentTabHost.doTabChanged(FragmentTabHost.java:330)
08-20 10:02:04.195: E/AndroidRuntime(13462): at android.support.v4.app.FragmentTabHost.onAttachedToWindow(FragmentTabHost.java:280)
08-20 10:02:04.195: E/AndroidRuntime(13462): at android.view.View.dispatchAttachedToWindow(View.java:11988)
08-20 10:02:04.195: E/AndroidRuntime(13462): at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2495)
08-20 10:02:04.195: E/AndroidRuntime(13462): at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2502)
08-20 10:02:04.195: E/AndroidRuntime(13462): at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2502)
08-20 10:02:04.195: E/AndroidRuntime(13462): at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2502)
08-20 10:02:04.195: E/AndroidRuntime(13462): at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2502)
08-20 10:02:04.195: E/AndroidRuntime(13462): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1363)
08-20 10:02:04.195: E/AndroidRuntime(13462): at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1139)
08-20 10:02:04.195: E/AndroidRuntime(13462): at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4879)
08-20 10:02:04.195: E/AndroidRuntime(13462): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:776)
08-20 10:02:04.195: E/AndroidRuntime(13462): at android.view.Choreographer.doCallbacks(Choreographer.java:579)
08-20 10:02:04.195: E/AndroidRuntime(13462): at android.view.Choreographer.doFrame(Choreographer.java:548)
08-20 10:02:04.195: E/AndroidRuntime(13462): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:762)
08-20 10:02:04.195: E/AndroidRuntime(13462): at android.os.Handler.handleCallback(Handler.java:725)
08-20 10:02:04.195: E/AndroidRuntime(13462): at android.os.Handler.dispatchMessage(Handler.java:92)
08-20 10:02:04.195: E/AndroidRuntime(13462): at android.os.Looper.loop(Looper.java:153)
08-20 10:02:04.195: E/AndroidRuntime(13462): at android.app.ActivityThread.main(ActivityThread.java:5311)
08-20 10:02:04.195: E/AndroidRuntime(13462): at java.lang.reflect.Method.invokeNative(Native Method)
08-20 10:02:04.195: E/AndroidRuntime(13462): at java.lang.reflect.Method.invoke(Method.java:511)
08-20 10:02:04.195: E/AndroidRuntime(13462): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833)
08-20 10:02:04.195: E/AndroidRuntime(13462): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
08-20 10:02:04.195: E/AndroidRuntime(13462): at dalvik.system.NativeStart.main(Native Method)
Please help me I am struck.
Thanks in Advance!!

Having issues integrating Scandit SDK into my app

Decided to use Scandit SDK to get the barcode scanning feature in my app. Unfortunately, since I'm relatively new to Android development and Java in general I've run into a few issues that I can't seem to work out. The demo that Scandit provided doesn't give any errors(runs fine) but crashes when I try to start it up (pressing a button from one activity is meant to start it up). I've tried reading the logcat and googling a solution to the problems but I'm not getting the right solutions. Does anyone have an idea of what I'm doing wrong?
Logcat is provided below:
10-08 23:30:00.807 21563-21563/com.kwesimbia.management D/AndroidRuntime? Shutting down VM
10-08 23:30:00.807 21563-21563/com.kwesimbia.management W/dalvikvm? threadid=1: thread exiting with uncaught exception (group=0x40aa4228)
10-08 23:30:00.817 21563-21563/com.kwesimbia.management E/AndroidRuntime? FATAL EXCEPTION: main
java.lang.IllegalStateException: Could not execute method of the activity
at android.view.View$1.onClick(View.java:3082)
at android.view.View.performClick(View.java:3549)
at android.view.View$PerformClick.run(View.java:14393)
at android.os.Handler.handleCallback(Handler.java:605)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:4944)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at android.view.View$1.onClick(View.java:3077)
at android.view.View.performClick(View.java:3549)
at android.view.View$PerformClick.run(View.java:14393)
at android.os.Handler.handleCallback(Handler.java:605)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:4944)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NoClassDefFoundError: com.kwesimbia.management.ScanditSDKDemoSimple
at com.kwesimbia.management.Activity_D.initiateCodeScan(Activity_D.java:63)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at android.view.View$1.onClick(View.java:3077)
at android.view.View.performClick(View.java:3549)
at android.view.View$PerformClick.run(View.java:14393)
at android.os.Handler.handleCallback(Handler.java:605)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:4944)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)
10-08 23:30:00.817 32726-587/? E/EmbeddedLogger? App crashed!
Process: com.kwesimbia.management
10-08 23:30:00.817 32726-587/? E/EmbeddedLogger? App crashed!
Package: com.kwesimbia.management v1 (1.0)
10-08 23:30:00.817 32726-587/? E/EmbeddedLogger?
Application Label: firstapp
10-08 23:30:00.827 32726-587/? W/ActivityManager?
Force finishing activity com.kwesimbia.management/.Activity_D
I came across this problem as well, my solution was to extract the library files and put them as their files in the lib folder
The library basically isn't being exported with it
EDIT
So I checked out my project, basically I did these things:
In the libs folder I have a new folder called armeabi and inside that I have libscanditsdk-android-3.3.1.so
Then in my build path I have also referenced the jar file that they provide:
<classpathentry exported="true" kind="lib" path="C:/GIT/Android/FwayScannerProject/FwayScanner/libs/scanditsdk-barcodepicker-android-3.3.1.jar"/>

parsing data into Textviews in android

Parsing the simple data to textviews asynchronously
Trying to parse JSON to the three text views but getting error
I am applying Asynchronous way of parsing
I have used collection hashmap to store data
Any Ideas on how to successfully parse the JSON to the Textviews
Thanks,
MainActivity.java
public class MainActivity extends Activity {
private static String url1 = "http://54.218.73.244:7002/RestaurantTimings";
private HashMap<Integer, String> contentsMap = new HashMap<Integer, String>();
ProgressDialog progressDialog;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
//instantiating progressDialog
progressDialog=new ProgressDialog(MainActivity.this);
new ParsingAsync().execute();
}
private class ParsingAsync extends AsyncTask<Void, Void, Void>{
#Override
protected void onPreExecute() {
// TODO Auto-generated method stub
super.onPreExecute();
progressDialog=ProgressDialog.show(MainActivity.this, "", "Please Wait .. ", true, false);
}
#Override
protected Void doInBackground(Void... params) {
// TODO Auto-generated method stub
JSONObjParser jParser=new JSONObjParser();
JSONArray json1=jParser.getJSONFromUrl(url1);
try{
for(int i=0;i<json1.length();i++){
JSONObject c=json1.getJSONObject(i);
int id = c.getInt("_id");
String TIME = c.getString("RestaurantTime");
contentsMap.put(id,TIME);
}
}catch (JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return null;
}
#Override
protected void onPostExecute(Void result) {
// TODO Auto-generated method stub
super.onPostExecute(result);
progressDialog.dismiss();
TextView TV1=(TextView) findViewById(R.id.restaurantTimings1);
TV1.setText(contentsMap.get(1));
TextView TV2=(TextView) findViewById(R.id.restaurantTimings2);
TV1.setText(contentsMap.get(2));
TextView TV3=(TextView) findViewById(R.id.restaurantTimings3);
TV1.setText(contentsMap.get(3));
}
}
}
log
08-20 20:40:21.642: W/System.err(482): java.net.SocketException: Permission denied
08-20 20:40:21.642: W/System.err(482): at org.apache.harmony.luni.platform.OSNetworkSystem.socket(Native Method)
08-20 20:40:21.652: W/System.err(482): at dalvik.system.BlockGuard$WrappedNetworkSystem.socket(BlockGuard.java:335)
08-20 20:40:21.652: W/System.err(482): at org.apache.harmony.luni.net.PlainSocketImpl.create(PlainSocketImpl.java:216)
08-20 20:40:21.652: W/System.err(482): at java.net.Socket.checkOpenAndCreate(Socket.java:802)
08-20 20:40:21.652: W/System.err(482): at java.net.Socket.connect(Socket.java:948)
08-20 20:40:21.662: W/System.err(482): at org.apache.http.conn.scheme.PlainSocketFactory.connectSocket(PlainSocketFactory.java:119)
08-20 20:40:21.662: W/System.err(482): at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:143)
08-20 20:40:21.662: W/System.err(482): at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164)
08-20 20:40:21.662: W/System.err(482): at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119)
08-20 20:40:21.662: W/System.err(482): at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:359)
08-20 20:40:21.662: W/System.err(482): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)
08-20 20:40:21.662: W/System.err(482): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)
08-20 20:40:21.682: W/System.err(482): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465)
08-20 20:40:21.692: W/System.err(482): at com.example.simpleasynctask.JSONObjParser.getJSONFromUrl(JSONObjParser.java:40)
08-20 20:40:21.692: W/System.err(482): at com.example.simpleasynctask.MainActivity$ParsingAsync.doInBackground(MainActivity.java:50)
08-20 20:40:21.692: W/System.err(482): at com.example.simpleasynctask.MainActivity$ParsingAsync.doInBackground(MainActivity.java:1)
08-20 20:40:21.692: W/System.err(482): at android.os.AsyncTask$2.call(AsyncTask.java:185)
08-20 20:40:21.692: W/System.err(482): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:306)
08-20 20:40:21.692: W/System.err(482): at java.util.concurrent.FutureTask.run(FutureTask.java:138)
08-20 20:40:21.702: W/System.err(482): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088)
08-20 20:40:21.702: W/System.err(482): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581)
08-20 20:40:21.702: W/System.err(482): at java.lang.Thread.run(Thread.java:1019)
08-20 20:40:21.712: E/Buffer Error(482): Error converting result java.lang.NullPointerException
08-20 20:40:21.712: E/JSON Parser(482): Error parsing data org.json.JSONException: End of input at character 0 of
08-20 20:40:21.722: W/dalvikvm(482): threadid=9: thread exiting with uncaught exception (group=0x40015560)
08-20 20:40:21.732: E/AndroidRuntime(482): FATAL EXCEPTION: AsyncTask #1
08-20 20:40:21.732: E/AndroidRuntime(482): java.lang.RuntimeException: An error occured while executing doInBackground()
08-20 20:40:21.732: E/AndroidRuntime(482): at android.os.AsyncTask$3.done(AsyncTask.java:200)
08-20 20:40:21.732: E/AndroidRuntime(482): at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:274)
08-20 20:40:21.732: E/AndroidRuntime(482): at java.util.concurrent.FutureTask.setException(FutureTask.java:125)
08-20 20:40:21.732: E/AndroidRuntime(482): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:308)
08-20 20:40:21.732: E/AndroidRuntime(482): at java.util.concurrent.FutureTask.run(FutureTask.java:138)
08-20 20:40:21.732: E/AndroidRuntime(482): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088)
08-20 20:40:21.732: E/AndroidRuntime(482): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581)
08-20 20:40:21.732: E/AndroidRuntime(482): at java.lang.Thread.run(Thread.java:1019)
08-20 20:40:21.732: E/AndroidRuntime(482): Caused by: java.lang.NullPointerException
08-20 20:40:21.732: E/AndroidRuntime(482): at com.example.simpleasynctask.MainActivity$ParsingAsync.doInBackground(MainActivity.java:53)
08-20 20:40:21.732: E/AndroidRuntime(482): at com.example.simpleasynctask.MainActivity$ParsingAsync.doInBackground(MainActivity.java:1)
08-20 20:40:21.732: E/AndroidRuntime(482): at android.os.AsyncTask$2.call(AsyncTask.java:185)
08-20 20:40:21.732: E/AndroidRuntime(482): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:306)
08-20 20:40:21.732: E/AndroidRuntime(482): ... 4 more
08-20 20:40:22.722: E/WindowManager(482): Activity com.example.simpleasynctask.MainActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView#4051e148 that was originally added here
08-20 20:40:22.722: E/WindowManager(482): android.view.WindowLeaked: Activity com.example.simpleasynctask.MainActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView#4051e148 that was originally added here
08-20 20:40:22.722: E/WindowManager(482): at android.view.ViewRoot.<init>(ViewRoot.java:258)
08-20 20:40:22.722: E/WindowManager(482): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:148)
08-20 20:40:22.722: E/WindowManager(482): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)
08-20 20:40:22.722: E/WindowManager(482): at android.view.Window$LocalWindowManager.addView(Window.java:424)
08-20 20:40:22.722: E/WindowManager(482): at android.app.Dialog.show(Dialog.java:241)
08-20 20:40:22.722: E/WindowManager(482): at android.app.ProgressDialog.show(ProgressDialog.java:107)
08-20 20:40:22.722: E/WindowManager(482): at android.app.ProgressDialog.show(ProgressDialog.java:95)
08-20 20:40:22.722: E/WindowManager(482): at com.example.simpleasynctask.MainActivity$ParsingAsync.onPreExecute(MainActivity.java:43)
08-20 20:40:22.722: E/WindowManager(482): at android.os.AsyncTask.execute(AsyncTask.java:391)
08-20 20:40:22.722: E/WindowManager(482): at com.example.simpleasynctask.MainActivity.onCreate(MainActivity.java:34)
08-20 20:40:22.722: E/WindowManager(482): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
08-20 20:40:22.722: E/WindowManager(482): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
08-20 20:40:22.722: E/WindowManager(482): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
08-20 20:40:22.722: E/WindowManager(482): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
08-20 20:40:22.722: E/WindowManager(482): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
08-20 20:40:22.722: E/WindowManager(482): at android.os.Handler.dispatchMessage(Handler.java:99)
08-20 20:40:22.722: E/WindowManager(482): at android.os.Looper.loop(Looper.java:123)
08-20 20:40:22.722: E/WindowManager(482): at android.app.ActivityThread.main(ActivityThread.java:3683)
08-20 20:40:22.722: E/WindowManager(482): at java.lang.reflect.Method.invokeNative(Native Method)
08-20 20:40:22.722: E/WindowManager(482): at java.lang.reflect.Method.invoke(Method.java:507)
08-20 20:40:22.722: E/WindowManager(482): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
08-20 20:40:22.722: E/WindowManager(482): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
08-20 20:40:22.722: E/WindowManager(482): at dalvik.system.NativeStart.main(Native Method)
08-20 20:45:21.996: I/Process(482): Sending signal. PID: 482 SIG: 9
08-20 20:47:11.752: W/System.err(519): java.net.SocketException: Permission denied
08-20 20:47:11.772: W/System.err(519): at org.apache.harmony.luni.platform.OSNetworkSystem.socket(Native Method)
08-20 20:47:11.782: W/System.err(519): at dalvik.system.BlockGuard$WrappedNetworkSystem.socket(BlockGuard.java:335)
08-20 20:47:11.782: W/System.err(519): at org.apache.harmony.luni.net.PlainSocketImpl.create(PlainSocketImpl.java:216)
08-20 20:47:11.782: W/System.err(519): at java.net.Socket.checkOpenAndCreate(Socket.java:802)
08-20 20:47:11.782: W/System.err(519): at java.net.Socket.connect(Socket.java:948)
08-20 20:47:11.782: W/System.err(519): at org.apache.http.conn.scheme.PlainSocketFactory.connectSocket(PlainSocketFactory.java:119)
08-20 20:47:11.782: W/System.err(519): at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:143)
08-20 20:47:11.782: W/System.err(519): at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164)
08-20 20:47:11.792: W/System.err(519): at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119)
08-20 20:47:11.792: W/System.err(519): at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:359)
08-20 20:47:11.803: W/System.err(519): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)
08-20 20:47:11.803: W/System.err(519): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)
08-20 20:47:11.803: W/System.err(519): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465)
08-20 20:47:11.803: W/System.err(519): at com.example.simpleasynctask.JSONObjParser.getJSONFromUrl(JSONObjParser.java:40)
08-20 20:47:11.812: W/System.err(519): at com.example.simpleasynctask.MainActivity$ParsingAsync.doInBackground(MainActivity.java:50)
08-20 20:47:11.812: W/System.err(519): at com.example.simpleasynctask.MainActivity$ParsingAsync.doInBackground(MainActivity.java:1)
08-20 20:47:11.812: W/System.err(519): at android.os.AsyncTask$2.call(AsyncTask.java:185)
08-20 20:47:11.853: W/System.err(519): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:306)
08-20 20:47:11.853: W/System.err(519): at java.util.concurrent.FutureTask.run(FutureTask.java:138)
08-20 20:47:11.853: W/System.err(519): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088)
08-20 20:47:11.853: W/System.err(519): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581)
08-20 20:47:11.862: W/System.err(519): at java.lang.Thread.run(Thread.java:1019)
08-20 20:47:11.862: E/Buffer Error(519): Error converting result java.lang.NullPointerException
08-20 20:47:11.892: E/JSON Parser(519): Error parsing data org.json.JSONException: End of input at character 0 of
08-20 20:47:11.904: W/dalvikvm(519): threadid=9: thread exiting with uncaught exception (group=0x40015560)
08-20 20:47:11.912: E/AndroidRuntime(519): FATAL EXCEPTION: AsyncTask #1
08-20 20:47:11.912: E/AndroidRuntime(519): java.lang.RuntimeException: An error occured while executing doInBackground()
08-20 20:47:11.912: E/AndroidRuntime(519): at android.os.AsyncTask$3.done(AsyncTask.java:200)
08-20 20:47:11.912: E/AndroidRuntime(519): at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:274)
08-20 20:47:11.912: E/AndroidRuntime(519): at java.util.concurrent.FutureTask.setException(FutureTask.java:125)
08-20 20:47:11.912: E/AndroidRuntime(519): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:308)
08-20 20:47:11.912: E/AndroidRuntime(519): at java.util.concurrent.FutureTask.run(FutureTask.java:138)
08-20 20:47:11.912: E/AndroidRuntime(519): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088)
08-20 20:47:11.912: E/AndroidRuntime(519): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581)
08-20 20:47:11.912: E/AndroidRuntime(519): at java.lang.Thread.run(Thread.java:1019)
08-20 20:47:11.912: E/AndroidRuntime(519): Caused by: java.lang.NullPointerException
08-20 20:47:11.912: E/AndroidRuntime(519): at com.example.simpleasynctask.MainActivity$ParsingAsync.doInBackground(MainActivity.java:53)
08-20 20:47:11.912: E/AndroidRuntime(519): at com.example.simpleasynctask.MainActivity$ParsingAsync.doInBackground(MainActivity.java:1)
08-20 20:47:11.912: E/AndroidRuntime(519): at android.os.AsyncTask$2.call(AsyncTask.java:185)
08-20 20:47:11.912: E/AndroidRuntime(519): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:306)
08-20 20:47:11.912: E/AndroidRuntime(519): ... 4 more
08-20 20:47:14.072: E/WindowManager(519): Activity com.example.simpleasynctask.MainActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView#4051e498 that was originally added here
08-20 20:47:14.072: E/WindowManager(519): android.view.WindowLeaked: Activity com.example.simpleasynctask.MainActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView#4051e498 that was originally added here
08-20 20:47:14.072: E/WindowManager(519): at android.view.ViewRoot.<init>(ViewRoot.java:258)
08-20 20:47:14.072: E/WindowManager(519): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:148)
08-20 20:47:14.072: E/WindowManager(519): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)
08-20 20:47:14.072: E/WindowManager(519): at android.view.Window$LocalWindowManager.addView(Window.java:424)
08-20 20:47:14.072: E/WindowManager(519): at android.app.Dialog.show(Dialog.java:241)
08-20 20:47:14.072: E/WindowManager(519): at android.app.ProgressDialog.show(ProgressDialog.java:107)
08-20 20:47:14.072: E/WindowManager(519): at android.app.ProgressDialog.show(ProgressDialog.java:95)
08-20 20:47:14.072: E/WindowManager(519): at com.example.simpleasynctask.MainActivity$ParsingAsync.onPreExecute(MainActivity.java:43)
08-20 20:47:14.072: E/WindowManager(519): at android.os.AsyncTask.execute(AsyncTask.java:391)
08-20 20:47:14.072: E/WindowManager(519): at com.example.simpleasynctask.MainActivity.onCreate(MainActivity.java:34)
08-20 20:47:14.072: E/WindowManager(519): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
08-20 20:47:14.072: E/WindowManager(519): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
08-20 20:47:14.072: E/WindowManager(519): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
08-20 20:47:14.072: E/WindowManager(519): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
08-20 20:47:14.072: E/WindowManager(519): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
08-20 20:47:14.072: E/WindowManager(519): at android.os.Handler.dispatchMessage(Handler.java:99)
08-20 20:47:14.072: E/WindowManager(519): at android.os.Looper.loop(Looper.java:123)
08-20 20:47:14.072: E/WindowManager(519): at android.app.ActivityThread.main(ActivityThread.java:3683)
08-20 20:47:14.072: E/WindowManager(519): at java.lang.reflect.Method.invokeNative(Native Method)
08-20 20:47:14.072: E/WindowManager(519): at java.lang.reflect.Method.invoke(Method.java:507)
08-20 20:47:14.072: E/WindowManager(519): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
08-20 20:47:14.072: E/WindowManager(519): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
08-20 20:47:14.072: E/WindowManager(519): at dalvik.system.NativeStart.main(Native Method)
08-20 20:49:38.402: W/System.err(555): java.net.SocketException: Permission denied
08-20 20:49:38.434: W/System.err(555): at org.apache.harmony.luni.platform.OSNetworkSystem.socket(Native Method)
08-20 20:49:38.452: W/System.err(555): at dalvik.system.BlockGuard$WrappedNetworkSystem.socket(BlockGuard.java:335)
08-20 20:49:38.452: W/System.err(555): at org.apache.harmony.luni.net.PlainSocketImpl.create(PlainSocketImpl.java:216)
08-20 20:49:38.452: W/System.err(555): at java.net.Socket.checkOpenAndCreate(Socket.java:802)
08-20 20:49:38.452: W/System.err(555): at java.net.Socket.connect(Socket.java:948)
08-20 20:49:38.452: W/System.err(555): at org.apache.http.conn.scheme.PlainSocketFactory.connectSocket(PlainSocketFactory.java:119)
08-20 20:49:38.452: W/System.err(555): at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:143)
08-20 20:49:38.477: W/System.err(555): at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164)
08-20 20:49:38.482: W/System.err(555): at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119)
08-20 20:49:38.482: W/System.err(555): at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:359)
08-20 20:49:38.482: W/System.err(555): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)
08-20 20:49:38.482: W/System.err(555): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)
08-20 20:49:38.492: W/System.err(555): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465)
08-20 20:49:38.492: W/System.err(555): at com.example.simpleasynctask.JSONObjParser.getJSONFromUrl(JSONObjParser.java:40)
08-20 20:49:38.502: W/System.err(555): at com.example.simpleasynctask.MainActivity$ParsingAsync.doInBackground(MainActivity.java:50)
08-20 20:49:38.522: W/System.err(555): at com.example.simpleasynctask.MainActivity$ParsingAsync.doInBackground(MainActivity.java:1)
08-20 20:49:38.522: W/System.err(555): at android.os.AsyncTask$2.call(AsyncTask.java:185)
08-20 20:49:38.532: W/System.err(555): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:306)
08-20 20:49:38.542: W/System.err(555): at java.util.concurrent.FutureTask.run(FutureTask.java:138)
08-20 20:49:38.542: W/System.err(555): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088)
08-20 20:49:38.552: W/System.err(555): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581)
08-20 20:49:38.552: W/System.err(555): at java.lang.Thread.run(Thread.java:1019)
08-20 20:49:38.563: E/Buffer Error(555): Error converting result java.lang.NullPointerException
08-20 20:49:38.582: E/JSON Parser(555): Error parsing data org.json.JSONException: End of input at character 0 of
08-20 20:49:38.632: W/dalvikvm(555): threadid=9: thread exiting with uncaught exception (group=0x40015560)
08-20 20:49:38.642: E/AndroidRuntime(555): FATAL EXCEPTION: AsyncTask #1
08-20 20:49:38.642: E/AndroidRuntime(555): java.lang.RuntimeException: An error occured while executing doInBackground()
08-20 20:49:38.642: E/AndroidRuntime(555): at android.os.AsyncTask$3.done(AsyncTask.java:200)
08-20 20:49:38.642: E/AndroidRuntime(555): at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:274)
08-20 20:49:38.642: E/AndroidRuntime(555): at java.util.concurrent.FutureTask.setException(FutureTask.java:125)
08-20 20:49:38.642: E/AndroidRuntime(555): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:308)
08-20 20:49:38.642: E/AndroidRuntime(555): at java.util.concurrent.FutureTask.run(FutureTask.java:138)
08-20 20:49:38.642: E/AndroidRuntime(555): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088)
08-20 20:49:38.642: E/AndroidRuntime(555): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581)
08-20 20:49:38.642: E/AndroidRuntime(555): at java.lang.Thread.run(Thread.java:1019)
08-20 20:49:38.642: E/AndroidRuntime(555): Caused by: java.lang.NullPointerException
08-20 20:49:38.642: E/AndroidRuntime(555): at com.example.simpleasynctask.MainActivity$ParsingAsync.doInBackground(MainActivity.java:53)
08-20 20:49:38.642: E/AndroidRuntime(555): at com.example.simpleasynctask.MainActivity$ParsingAsync.doInBackground(MainActivity.java:1)
08-20 20:49:38.642: E/AndroidRuntime(555): at android.os.AsyncTask$2.call(AsyncTask.java:185)
08-20 20:49:38.642: E/AndroidRuntime(555): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:306)
08-20 20:49:38.642: E/AndroidRuntime(555): ... 4 more
08-20 20:49:40.662: E/WindowManager(555): Activity com.example.simpleasynctask.MainActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView#4051e7f0 that was originally added here
08-20 20:49:40.662: E/WindowManager(555): android.view.WindowLeaked: Activity com.example.simpleasynctask.MainActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView#4051e7f0 that was originally added here
08-20 20:49:40.662: E/WindowManager(555): at android.view.ViewRoot.<init>(ViewRoot.java:258)
08-20 20:49:40.662: E/WindowManager(555): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:148)
08-20 20:49:40.662: E/WindowManager(555): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)
08-20 20:49:40.662: E/WindowManager(555): at android.view.Window$LocalWindowManager.addView(Window.java:424)
08-20 20:49:40.662: E/WindowManager(555): at android.app.Dialog.show(Dialog.java:241)
08-20 20:49:40.662: E/WindowManager(555): at android.app.ProgressDialog.show(ProgressDialog.java:107)
08-20 20:49:40.662: E/WindowManager(555): at android.app.ProgressDialog.show(ProgressDialog.java:95)
08-20 20:49:40.662: E/WindowManager(555): at com.example.simpleasynctask.MainActivity$ParsingAsync.onPreExecute(MainActivity.java:43)
08-20 20:49:40.662: E/WindowManager(555): at android.os.AsyncTask.execute(AsyncTask.java:391)
08-20 20:49:40.662: E/WindowManager(555): at com.example.simpleasynctask.MainActivity.onCreate(MainActivity.java:34)
08-20 20:49:40.662: E/WindowManager(555): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
08-20 20:49:40.662: E/WindowManager(555): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
08-20 20:49:40.662: E/WindowManager(555): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
08-20 20:49:40.662: E/WindowManager(555): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
08-20 20:49:40.662: E/WindowManager(555): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
08-20 20:49:40.662: E/WindowManager(555): at android.os.Handler.dispatchMessage(Handler.java:99)
08-20 20:49:40.662: E/WindowManager(555): at android.os.Looper.loop(Looper.java:123)
08-20 20:49:40.662: E/WindowManager(555): at android.app.ActivityThread.main(ActivityThread.java:3683)
08-20 20:49:40.662: E/WindowManager(555): at java.lang.reflect.Method.invokeNative(Native Method)
08-20 20:49:40.662: E/WindowManager(555): at java.lang.reflect.Method.invoke(Method.java:507)
08-20 20:49:40.662: E/WindowManager(555): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
08-20 20:49:40.662: E/WindowManager(555): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
08-20 20:49:40.662: E/WindowManager(555): at dalvik.system.NativeStart.main(Native Method)
UPDATE
After adding internet permission
No errors in error log
But i cannot populate the remaining two text views
activity_main.xml
<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"
android:paddingBottom="#dimen/activity_vertical_margin"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin"
tools:context=".MainActivity" >
<TextView
android:id="#+id/restaurantTimings1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:text="TextView" />
<TextView
android:id="#+id/restaurantTimings2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/textView2"
android:layout_centerHorizontal="true"
android:layout_marginTop="133dp"
android:text="TextView" />
<TextView
android:id="#+id/restaurantTimings3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/restaurantTimings2"
android:layout_alignLeft="#+id/restaurantTimings2"
android:layout_marginBottom="68dp"
android:text="TextView" />
</RelativeLayout>
Firstly,
From your logs :- java.net.SocketException: Permission denied its
clear you haven't added internet permissions, so you have to add
<uses-permission android:name="android.permission.INTERNET"/> in
your manifest file
Secondly
you haven't setText to your other TextView.. refer below code,..
#Override
protected void onPostExecute(Void result) {
// TODO Auto-generated method stub
super.onPostExecute(result);
progressDialog.dismiss();
TextView TV1=(TextView) findViewById(R.id.restaurantTimings1);
TV1.setText(contentsMap.get(1));
TextView TV2=(TextView) findViewById(R.id.restaurantTimings2);
TV2.setText(contentsMap.get(2));//Here........
TextView TV3=(TextView) findViewById(R.id.restaurantTimings3);
TV3.setText(contentsMap.get(3));//Here.........
}

Error inflating jfeinstein sliding menu class

I have an app where there is a sliding menu. I have implemented it using the jfeinstein's library. It was working perfectly fine till yesterday but it has stopped working now. I haven't even made any changes to the code. Here is the error report:
08-20 15:02:52.060: E/AndroidRuntime(32366): FATAL EXCEPTION: main
08-20 15:02:52.060: E/AndroidRuntime(32366): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.cvapp/com.cvapp.SecondActivity}: android.view.InflateException: Binary XML file line #2: Error inflating class com.jeremyfeinstein.slidingmenu.lib.SlidingMenu
08-20 15:02:52.060: E/AndroidRuntime(32366): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2100)
08-20 15:02:52.060: E/AndroidRuntime(32366): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2125)
08-20 15:02:52.060: E/AndroidRuntime(32366): at android.app.ActivityThread.access$600(ActivityThread.java:140)
08-20 15:02:52.060: E/AndroidRuntime(32366): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1227)
08-20 15:02:52.060: E/AndroidRuntime(32366): at android.os.Handler.dispatchMessage(Handler.java:99)
08-20 15:02:52.060: E/AndroidRuntime(32366): at android.os.Looper.loop(Looper.java:137)
08-20 15:02:52.060: E/AndroidRuntime(32366): at android.app.ActivityThread.main(ActivityThread.java:4898)
08-20 15:02:52.060: E/AndroidRuntime(32366): at java.lang.reflect.Method.invokeNative(Native Method)
08-20 15:02:52.060: E/AndroidRuntime(32366): at java.lang.reflect.Method.invoke(Method.java:511)
08-20 15:02:52.060: E/AndroidRuntime(32366): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1006)
08-20 15:02:52.060: E/AndroidRuntime(32366): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:773)
08-20 15:02:52.060: E/AndroidRuntime(32366): at dalvik.system.NativeStart.main(Native Method)
08-20 15:02:52.060: E/AndroidRuntime(32366): Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class com.jeremyfeinstein.slidingmenu.lib.SlidingMenu
08-20 15:02:52.060: E/AndroidRuntime(32366): at android.view.LayoutInflater.createView(LayoutInflater.java:613)
08-20 15:02:52.060: E/AndroidRuntime(32366): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:687)
08-20 15:02:52.060: E/AndroidRuntime(32366): at android.view.LayoutInflater.inflate(LayoutInflater.java:466)
08-20 15:02:52.060: E/AndroidRuntime(32366): at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
08-20 15:02:52.060: E/AndroidRuntime(32366): at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
08-20 15:02:52.060: E/AndroidRuntime(32366): at com.jeremyfeinstein.slidingmenu.lib.app.SlidingActivityHelper.onCreate(SlidingActivityHelper.java:45)
08-20 15:02:52.060: E/AndroidRuntime(32366): at com.jeremyfeinstein.slidingmenu.lib.app.SlidingActivity.onCreate(SlidingActivity.java:22)
08-20 15:02:52.060: E/AndroidRuntime(32366): at com.cvapp.SecondActivity.onCreate(SecondActivity.java:19)
08-20 15:02:52.060: E/AndroidRuntime(32366): at android.app.Activity.performCreate(Activity.java:5206)
08-20 15:02:52.060: E/AndroidRuntime(32366): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1083)
08-20 15:02:52.060: E/AndroidRuntime(32366): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2064)
08-20 15:02:52.060: E/AndroidRuntime(32366): ... 11 more
08-20 15:02:52.060: E/AndroidRuntime(32366): Caused by: java.lang.reflect.InvocationTargetException
08-20 15:02:52.060: E/AndroidRuntime(32366): at java.lang.reflect.Constructor.constructNative(Native Method)
08-20 15:02:52.060: E/AndroidRuntime(32366): at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
08-20 15:02:52.060: E/AndroidRuntime(32366): at android.view.LayoutInflater.createView(LayoutInflater.java:587)
08-20 15:02:52.060: E/AndroidRuntime(32366): ... 21 more
08-20 15:02:52.060: E/AndroidRuntime(32366): Caused by: java.lang.NoClassDefFoundError: android.support.v4.view.ViewConfigurationCompat
08-20 15:02:52.060: E/AndroidRuntime(32366): at com.jeremyfeinstein.slidingmenu.lib.CustomViewAbove.initCustomViewAbove(CustomViewAbove.java:167)
08-20 15:02:52.060: E/AndroidRuntime(32366): at com.jeremyfeinstein.slidingmenu.lib.CustomViewAbove.<init>(CustomViewAbove.java:157)
08-20 15:02:52.060: E/AndroidRuntime(32366): at com.jeremyfeinstein.slidingmenu.lib.CustomViewAbove.<init>(CustomViewAbove.java:152)
08-20 15:02:52.060: E/AndroidRuntime(32366): at com.jeremyfeinstein.slidingmenu.lib.SlidingMenu.<init>(SlidingMenu.java:209)
08-20 15:02:52.060: E/AndroidRuntime(32366): at com.jeremyfeinstein.slidingmenu.lib.SlidingMenu.<init>(SlidingMenu.java:192)
08-20 15:02:52.060: E/AndroidRuntime(32366): ... 24 more
Here is my code:
main:
package com.cvapp;
import com.jeremyfeinstein.slidingmenu.lib.SlidingMenu;
import com.jeremyfeinstein.slidingmenu.lib.app.SlidingActivity;
import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.widget.Button;
import android.widget.ImageButton;
public class SecondActivity extends SlidingActivity {
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_second);
setBehindContentView(R.layout.activity_menu1);
getSlidingMenu().setBehindOffset(100);
SlidingMenu menu = getSlidingMenu();
menu.setTouchModeAbove(SlidingMenu.TOUCHMODE_FULLSCREEN);
setOnClickListener();
}
#Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.second, menu);
return true;
}
}
xml:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:background="#drawable/pic9"
android:clickable="true"
android:paddingBottom="#dimen/activity_vertical_margin"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin"
tools:context=".SecondActivity" >
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginLeft="16dp"
android:layout_marginTop="27dp"
android:text="Hello"
android:textColor="#000000"
android:textSize="16sp"
android:textStyle="bold" />
</RelativeLayout>
And, if it helps, I have followed this tutorial to set up the Sliding Menu.
FYI, you'd better add support package v4 from library project, instead of copy it to local libs. And remember to add library to your sliding menu application.
Finally I got it.. u just have to right click on your project > Android Tools > Add Support Library, so the prblem was the missing support package v4..
I have got the same issue and I have resolved finally Opening the gradle.properties and added following:
android.enableAapt2=false

Screen orientation in PhoneGap / Android [duplicate]

This question already has answers here:
Phonegap app crashes when switched orientation even with AndroidManifest changes
(2 answers)
Closed 3 years ago.
I'm currently developing a small demo in PhoneGap to test out some functionalities. I want to use the PhoneGap-OrientationLock plugin available from Github to be able to dynamically change my screen orientation from JavaScript, I've updated the plugin to use it in Cordova.
My problem right now is that it crashes as soon as I want to change my screen orientation. Even if I try something as simple as setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); (without using PhoneGap technically) from my onCreate method, my application just quits to the launcher with the following debug log:
08-20 08:57:17.083: D/DroidGap(21383): DroidGap.onCreate()
08-20 08:57:17.193: D/CordovaWebView(21383): Origin to allow: http://127.0.0.1*
08-20 08:57:17.193: I/CordovaLog(21383): Found log level DEBUG
08-20 08:57:17.193: I/CordovaLog(21383): Changing log level to DEBUG(3)
08-20 08:57:17.193: I/CordovaLog(21383): Found preference for fullscreen=true
08-20 08:57:17.193: D/CordovaLog(21383): Found preference for fullscreen=true
08-20 08:57:17.193: I/CordovaLog(21383): Found preference for useBrowserHistory=false
08-20 08:57:17.193: D/CordovaLog(21383): Found preference for useBrowserHistory=false
08-20 08:57:17.223: D/DroidGap(21383): DroidGap.init()
08-20 08:57:17.223: D/CordovaWebView(21383): >>> loadUrl(file:///android_asset/www/index.html)
08-20 08:57:17.223: D/PluginManager(21383): init()
08-20 08:57:17.233: D/CordovaWebView(21383): >>> loadUrlNow()
08-20 08:57:17.243: D/CordovaWebView(21383): >>> loadUrlNow()
08-20 08:57:17.243: D/DroidGap(21383): onDestroy()
08-20 08:57:17.243: D/CordovaWebView(21383): >>> loadUrlNow()
08-20 08:57:17.243: D/CordovaWebView(21383): >>> loadUrlNow()
08-20 08:57:17.263: D/DroidGap(21383): DroidGap.onCreate()
08-20 08:57:17.263: D/CordovaWebView(21383): Origin to allow: http://127.0.0.1*
08-20 08:57:17.263: I/CordovaLog(21383): Found log level DEBUG
08-20 08:57:17.263: I/CordovaLog(21383): Changing log level to DEBUG(3)
08-20 08:57:17.263: I/CordovaLog(21383): Found preference for fullscreen=true
08-20 08:57:17.263: D/CordovaLog(21383): Found preference for fullscreen=true
08-20 08:57:17.263: I/CordovaLog(21383): Found preference for useBrowserHistory=false
08-20 08:57:17.263: D/CordovaLog(21383): Found preference for useBrowserHistory=false
08-20 08:57:17.273: D/DroidGap(21383): DroidGap.init()
08-20 08:57:17.273: D/CordovaWebView(21383): >>> loadUrl(file:///android_asset/www/index.html)
08-20 08:57:17.273: D/PluginManager(21383): init()
08-20 08:57:17.293: D/CordovaWebView(21383): >>> loadUrlNow()
08-20 08:57:17.313: D/DroidGap(21383): onMessage(onPageStarted,file:///android_asset/www/index.html)
08-20 08:57:17.313: D/SoftKeyboardDetect(21383): Ignore this event
08-20 08:57:17.373: D/SoftKeyboardDetect(21383): Ignore this event
08-20 08:57:17.483: D/Cordova(21383): onPageFinished(file:///android_asset/www/index.html)
08-20 08:57:17.483: D/CordovaWebView(21383): >>> loadUrlNow()
08-20 08:57:17.483: D/DroidGap(21383): onMessage(onNativeReady,null)
08-20 08:57:17.483: D/DroidGap(21383): onMessage(onPageFinished,file:///android_asset/www/index.html)
08-20 08:57:17.483: D/DroidGap(21383): onMessage(onPageStarted,about:blank)
08-20 08:57:17.503: D/dalvikvm(21383): GC_CONCURRENT freed 326K, 9% free 7566K/8263K, paused 8ms+2ms, total 33ms
08-20 08:57:17.513: D/Cordova(21383): onPageFinished(about:blank)
08-20 08:57:17.513: D/DroidGap(21383): onMessage(onPageFinished,about:blank)
08-20 08:57:17.513: D/DroidGap(21383): onMessage(exit,null)
08-20 08:57:17.563: D/DroidGap(21383): onMessage(onPageStarted,file:///android_asset/www/index.html)
08-20 08:57:17.563: D/CordovaWebView(21383): >>> loadUrlNow()
08-20 08:57:18.023: D/Cordova(21383): onPageFinished(file:///android_asset/www/index.html)
08-20 08:57:18.023: D/CordovaWebView(21383): >>> loadUrlNow()
08-20 08:57:18.023: D/DroidGap(21383): onMessage(onNativeReady,null)
08-20 08:57:18.023: D/DroidGap(21383): onMessage(onPageFinished,file:///android_asset/www/index.html)
08-20 08:57:18.053: E/SQLiteLog(21383): (14) cannot open file at line 30174 of [00bb9c9ce4]
08-20 08:57:18.053: E/SQLiteLog(21383): (14) os_unix.c:30174: (2) open(/CachedGeoposition.db) -
08-20 08:57:18.053: D/WebKit(21383): ERROR:
08-20 08:57:18.053: D/WebKit(21383): SQLite database failed to load from /CachedGeoposition.db
08-20 08:57:18.053: D/WebKit(21383): Cause - unable to open database file
08-20 08:57:18.053: D/WebKit(21383): external/webkit/Source/WebCore/platform/sql/SQLiteDatabase.cpp(71) : bool WebCore::SQLiteDatabase::open(const WTF::String&, bool)
08-20 08:57:18.143: D/DroidGap(21383): onMessage(networkconnection,wifi)
08-20 08:57:18.183: D/DroidGap(21383): onMessage(spinner,stop)
08-20 08:57:18.223: W/IInputConnectionWrapper(21383): showStatusIcon on inactive InputConnection
08-20 08:57:18.263: D/DroidGap(21383): onDestroy()
08-20 08:57:18.263: D/CordovaWebView(21383): >>> loadUrlNow()
08-20 08:57:18.263: D/CordovaWebView(21383): >>> loadUrlNow()
08-20 08:57:18.283: D/DroidGap(21383): onMessage(onPageStarted,about:blank)
08-20 08:57:18.303: D/Cordova(21383): onPageFinished(about:blank)
08-20 08:57:18.303: D/DroidGap(21383): onMessage(onPageFinished,about:blank)
08-20 08:57:18.303: D/DroidGap(21383): onMessage(exit,null)
08-20 08:57:19.483: D/DroidGap(21383): onMessage(spinner,stop)
08-20 08:57:19.513: D/DroidGap(21383): onMessage(spinner,stop)
08-20 08:57:20.023: D/DroidGap(21383): onMessage(spinner,stop)
So it looks like as soon as I call setRequestedOrientation like so:
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
super.loadUrl("file:///android_asset/www/index.html");
}
My application calls onDestroy and goes back to the launcher. Am I just not understanding an Android concept? Anyone has a clue?
You should add android:configChanges="orientation|keyboardHidden" in the Android Manifest in the first <activity> that appears. I had the same problem, it crashed my app too.

Categories

Resources