android - Skipped xx-frames! The application may be doing too much work on its main thread -


i'm quite new android, tried making simple apps. 1 getting worse me. searched lot, should use "asynch" method or use "new runnable method", still not getting exact solution. here mainactivity.java:

package com.example.mit;  import android.os.bundle; import android.app.activity; import android.content.intent; import android.view.menu; import android.view.view; import android.view.view.onclicklistener;  public class mainactivity extends activity implements onclicklistener{      @override     protected void oncreate(bundle savedinstancestate) {         super.oncreate(savedinstancestate);         setcontentview(r.layout.activity_main);         }       @override     public boolean oncreateoptionsmenu(menu menu) {         // inflate menu; adds items action bar if present.         getmenuinflater().inflate(r.menu.main, menu);         return true;     }      public void onclick(view v) {         switch(v.getid())         {         case r.id.addition:             intent i1 = new intent(this,addition.class);             startactivityforresult(i1, 500);              break;         case r.id.overlap:             intent i2 = new intent(mainactivity.this,overlap.class);             startactivity(i2);             break;         case r.id.bcd:             intent i3 = new intent(mainactivity.this,bcd.class);             startactivity(i3);             break;         case r.id.string1:             intent i4 = new intent(mainactivity.this,string1.class);             startactivity(i4);             break;         case r.id.string2:             intent i5 = new intent(mainactivity.this,string2.class);             startactivity(i5);             break;         case r.id.mul:             intent i6 = new intent(mainactivity.this,mul.class);             startactivity(i6);             break;         case r.id.mean:             intent i7 = new intent(mainactivity.this,mean.class);             startactivity(i7);             break;         }        }     } 

this pretty simple code , you're getting warning because you're using emulator. if case, normal because emulators not fast real android devices. don't need use asynctask or runnable this.


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -