Android Studio problem solving series 1

1. What should I do if setOnPageChangeListener is outdated?

Using ViewPager today, I found that the method of setOnPageChangeListener has expired, and the AS compilation failed.

Solution: have an addOnPageChangeListener instead

2. What should I do if getDrawable is out of date?

technology sharing

solution:technology sharing

3. Simplified way of for loop in android

define an array int[] drawableIds = {R.drawable.a, R.drawable.b, R.drawable.c,.....};
 for (int id : ids) {
System.out.print(id+"\t");
}

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326984060&siteId=291194637