mohamed mohy mohamed mohy - 1 year ago 124
Android Question

Skipped 181 frames ... Android

Skipped 181 frames! The application may be doing too much work on its main thread

that appears when i run the code and click on the activity ... why is that appearing and how to get rid of it? here is my code

public class MainActivity extends AppCompatActivity {
public void Dropin(View v){
ImageView Counter = (ImageView)v;

protected void onCreate(Bundle savedInstanceState) {

Answer Source

Your code doesn't have any computationally heavy work so far. The only place is Counter.setImageResource( call. Maybe, your image is of much bigger size than you need and Android has to resize it. Another reason - use .png() format for resources, because transition has to make lot of calculations for formats such as .jpg and .bmp