Search Results

Search found 4 results on 1 pages for 'ninjasense'.

Page 1/1 | 1 

  • DexFile.class error in eclipse

    - by ninjasense
    I get this weird error everytime I debug in eclipse. It just seemed to appear one day and I was wondering if anyone else was running int the same problem. It does not affect my app in anyway visibly and does not cause a crash but it is an annoyance while debugging. Here is the full error: // Compiled from DexFile.java (version 1.5 : 49.0, super bit) public final class dalvik.system.DexFile { // Method descriptor #8 (Ljava/io/File;)V // Stack: 3, Locals: 2 public DexFile(java.io.File file) throws java.io.IOException; 0 aload_0 [this] 1 invokespecial java.lang.Object() [1] 4 new java.lang.RuntimeException [2] 7 dup 8 ldc <String "Stub!"> [3] 10 invokespecial java.lang.RuntimeException(java.lang.String) [4] 13 athrow Line numbers: [pc: 0, line: 4] Local variable table: [pc: 0, pc: 14] local: this index: 0 type: dalvik.system.DexFile [pc: 0, pc: 14] local: file index: 1 type: java.io.File // Method descriptor #18 (Ljava/lang/String;)V // Stack: 3, Locals: 2 public DexFile(java.lang.String fileName) throws java.io.IOException; 0 aload_0 [this] 1 invokespecial java.lang.Object() [1] 4 new java.lang.RuntimeException [2] 7 dup 8 ldc <String "Stub!"> [3] 10 invokespecial java.lang.RuntimeException(java.lang.String) [4] 13 athrow Line numbers: [pc: 0, line: 5] Local variable table: [pc: 0, pc: 14] local: this index: 0 type: dalvik.system.DexFile [pc: 0, pc: 14] local: fileName index: 1 type: java.lang.String // Method descriptor #22 (Ljava/lang/String;Ljava/lang/String;I)Ldalvik/system/DexFile; // Stack: 3, Locals: 3 public static dalvik.system.DexFile loadDex(java.lang.String sourcePathName, java.lang.String outputPathName, int flags) throws java.io.IOException; 0 new java.lang.RuntimeException [2] 3 dup 4 ldc <String "Stub!"> [3] 6 invokespecial java.lang.RuntimeException(java.lang.String) [4] 9 athrow Line numbers: [pc: 0, line: 6] Local variable table: [pc: 0, pc: 10] local: sourcePathName index: 0 type: java.lang.String [pc: 0, pc: 10] local: outputPathName index: 1 type: java.lang.String [pc: 0, pc: 10] local: flags index: 2 type: int // Method descriptor #28 ()Ljava/lang/String; // Stack: 3, Locals: 1 public java.lang.String getName(); 0 new java.lang.RuntimeException [2] 3 dup 4 ldc <String "Stub!"> [3] 6 invokespecial java.lang.RuntimeException(java.lang.String) [4] 9 athrow Line numbers: [pc: 0, line: 7] Local variable table: [pc: 0, pc: 10] local: this index: 0 type: dalvik.system.DexFile // Method descriptor #30 ()V // Stack: 3, Locals: 1 public void close() throws java.io.IOException; 0 new java.lang.RuntimeException [2] 3 dup 4 ldc <String "Stub!"> [3] 6 invokespecial java.lang.RuntimeException(java.lang.String) [4] 9 athrow Line numbers: [pc: 0, line: 8] Local variable table: [pc: 0, pc: 10] local: this index: 0 type: dalvik.system.DexFile // Method descriptor #32 (Ljava/lang/String;Ljava/lang/ClassLoader;)Ljava/lang/Class; // Stack: 3, Locals: 3 public java.lang.Class loadClass(java.lang.String name, java.lang.ClassLoader loader); 0 new java.lang.RuntimeException [2] 3 dup 4 ldc <String "Stub!"> [3] 6 invokespecial java.lang.RuntimeException(java.lang.String) [4] 9 athrow Line numbers: [pc: 0, line: 9] Local variable table: [pc: 0, pc: 10] local: this index: 0 type: dalvik.system.DexFile [pc: 0, pc: 10] local: name index: 1 type: java.lang.String [pc: 0, pc: 10] local: loader index: 2 type: java.lang.ClassLoader // Method descriptor #37 ()Ljava/util/Enumeration; // Signature: ()Ljava/util/Enumeration<Ljava/lang/String;>; // Stack: 3, Locals: 1 public java.util.Enumeration entries(); 0 new java.lang.RuntimeException [2] 3 dup 4 ldc <String "Stub!"> [3] 6 invokespecial java.lang.RuntimeException(java.lang.String) [4] 9 athrow Line numbers: [pc: 0, line: 10] Local variable table: [pc: 0, pc: 10] local: this index: 0 type: dalvik.system.DexFile // Method descriptor #30 ()V // Stack: 3, Locals: 1 protected void finalize() throws java.io.IOException; 0 new java.lang.RuntimeException [2] 3 dup 4 ldc <String "Stub!"> [3] 6 invokespecial java.lang.RuntimeException(java.lang.String) [4] 9 athrow Line numbers: [pc: 0, line: 11] Local variable table: [pc: 0, pc: 10] local: this index: 0 type: dalvik.system.DexFile // Method descriptor #42 (Ljava/lang/String;)Z public static native boolean isDexOptNeeded(java.lang.String arg0) throws java.io.FileNotFoundException, java.io.IOException; } Thanks

    Read the article

  • Android 2.1 NullPointerException with TabWidgets

    - by ninjasense
    I have an issue I have not been able to figure out and it is only happening on devices running <2.1. It works fine on android 2.2. I have ansynchronous task that displays a loading dialog while it loads all the tabs. Here is the code for the TabActivity: public class OppTabsView extends TabActivity { Dialog dialog; String errorText; boolean save; final int OPP_SAVE = 0; public static boolean edited; public void onCreate(Bundle icicle) { try { super.onCreate(icicle); new DoInBackground().execute(); } catch (Exception e) { Toast.makeText(this, "Error occured. Please try again later.", Toast.LENGTH_SHORT).show(); } } @Override protected void onResume() { super.onResume(); } @Override protected void onStop() { super.onStop(); } @Override protected void onPause() { super.onPause(); } public boolean onCreateOptionsMenu(Menu menu) { menu.add(0, OPP_SAVE, 0, "Test"); return true; } public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case OPP_SAVE: save = true; new DoInBackground().execute(); return true; } return false; } public void LoadOpp() { handler.sendEmptyMessage(0); } public void SaveOpp() { DoStuff(); } public void LoadLayout() { setContentView(R.layout.view_opptabs); /* TabHost will have Tabs */ TabHost tabHost = (TabHost) findViewById(android.R.id.tabhost); /* * TabSpec used to create a new tab. By using TabSpec only we can able * to setContent to the tab. By using TabSpec setIndicator() we can set * name to tab. */ /* tid1 is firstTabSpec Id. Its used to access outside. */ TabSpec firstTabSpec = tabHost.newTabSpec("tid1"); TabSpec secondTabSpec = tabHost.newTabSpec("tid1"); TabSpec thirdTabSpec = tabHost.newTabSpec("tid1"); /* TabSpec setIndicator() is used to set name for the tab. */ /* TabSpec setContent() is used to set content for a particular tab. */ firstTabSpec.setIndicator("General", getResources().getDrawable(R.drawable.tab_moneybag)) .setContent(new Intent(this, OppTabGeneral.class)); secondTabSpec.setIndicator("Details", getResources().getDrawable(R.drawable.tab_papers)).setContent( new Intent(this, OppTabDetails.class)); thirdTabSpec.setIndicator("Contact", getResources().getDrawable(R.drawable.tab_contact)).setContent( new Intent(this, OppTabContact.class)); /* Add tabSpec to the TabHost to display. */ tabHost.addTab(firstTabSpec); tabHost.addTab(secondTabSpec); tabHost.addTab(thirdTabSpec); } private void do_update() { if (save) { SaveOpp(); } else { LoadOpp(); } } Handler handler = new Handler() { public void handleMessage(Message msg) { LoadLayout(); } }; private class DoInBackground extends AsyncTask<Void, Void, Void> implements DialogInterface.OnCancelListener { protected void onPreExecute() { String verb = "Connecting"; if (save) { verb = "Saving"; } dialog = ProgressDialog.show(OppTabsView.this, "", verb + ". Please Wait...", true, true, this); } protected Void doInBackground(Void... v) { do_update(); return null; } protected void onPostExecute(Void v) { dialog.dismiss(); } public void onCancel(DialogInterface dialog) { cancel(true); dialog.dismiss(); finish(); } } } Here is the stack trace from the error: java.lang.NullPointerException at android.widget.TabWidget.dispatchDraw(TabWidget.java:206) at android.view.ViewGroup.drawChild(ViewGroup.java:1529) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258) at android.view.ViewGroup.drawChild(ViewGroup.java:1529) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258) at android.view.ViewGroup.drawChild(ViewGroup.java:1529) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258) at android.view.View.draw(View.java:6538) at android.widget.FrameLayout.draw(FrameLayout.java:352) at android.view.ViewGroup.drawChild(ViewGroup.java:1531) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258) at android.view.ViewGroup.drawChild(ViewGroup.java:1529) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258) at android.view.View.draw(View.java:6538) at android.widget.FrameLayout.draw(FrameLayout.java:352) at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:1830) at android.view.ViewRoot.draw(ViewRoot.java:1349) at android.view.ViewRoot.performTraversals(ViewRoot.java:1114) at android.view.ViewRoot.handleMessage(ViewRoot.java:1633) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:123) at android.app.ActivityThread.main(ActivityThread.java:4363) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:521) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618) at dalvik.system.NativeStart.main(Native Method) I have tried stepping through it but the error seems to come out of no where, not at a specific line. Any help is greatly appreciated.

    Read the article

  • How do I correctly use generics?

    - by ninjasense
    I basically am making webrequests and recieving a JSON response. Depending on the request, I am parsing JSON request into objects I have created. The parsing is pretty much the same no matter what the object Im parsing into looks like. So I have a bunch of methods doing the same work only with different objects, I was wondering how I could accomplish this with generics? Here is an example public static ArrayList<Contact> parseContacts(String responseData) { ArrayList<Contact> Contacts = new ArrayList<Contact>(); try { JSONArray jsonContacts = new JSONArray(responseData); if (!jsonContacts.isNull(0)) { for (int i = 0; i < jsonContacts.length(); i++) { Contacts.add(new Contact(jsonContacts.getJSONObject(i))); } } } catch (JSONException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (Exception e) { } return Contacts; }

    Read the article

  • Correct way to add objects to an ArrayList

    - by ninjasense
    I am trying to add an object to an arraylist but when I view the results of the array list, it keeps adding the same object over and over to the arraylist. I was wondering what the correct way to implement this would be. public static ArrayList<Person> parsePeople(String responseData) { ArrayList<Person> People = new ArrayList<Person>(); try { JSONArray jsonPeople = new JSONArray(responseData); if (!jsonPeople.isNull(0)) { for (int i = 0; i < jsonPeople.length(); i++) { Person.add(new Person(jsonPeople.getJSONObject(i))); } } } catch (JSONException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (Exception e) { } return People; } I have double checked my JSONArray data and made sure they are not duplicates. It seems to keep adding the first object over and over.

    Read the article

1