I brought some interesting problem.
It is about Nullpointer exception and it is only occur at specific phone, Samsung Galaxy Note3-5.1.0. Since I didn't checked all the other phones, however, running on genymotion-samasung-galaxyS5-4.4.4 was fine.
The code is following.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
final LinearLayout btn_search = (LinearLayout) findViewById(R.id.searchBtn);
final LinearLayout btn_mypage = (LinearLayout) findViewById(R.id.mypageBtn);
final LinearLayout btn_map = (LinearLayout) findViewById(R.id.mapBtn);
Log.d("NULLPOINTER",": " + btn_search + " " + btn_map + " " + btn_mypage);
}
Then, the log is like,
D/NULLPOINTER: : null android.widget.LinearLayout{2ae0be1a V.E..... ......I. 0,0-0,0 #7f0e007d app:id/mapBtn} android.widget.LinearLayout{1db90d4b V.E...C. ......I. 0,0-0,0 #7f0e007e app:id/mypageBtn}
I checked all the R.id.*** and layout and since they are implemented in same way, I don't know what is the problem. Strangely, only the first one, which was lastly added is always null. However, on the other phones I can get the object well.
Do you know any idea?