Very simple – call the indexOfChild function on the view’s parent:
LinearLayout addNoteLayout = (LinearLayout) findViewById(R.id.llAddNote);
int index = ((ViewGroup) addNoteLayout.getParent()).indexOfChild(addNoteLayout);
Very simple – call the indexOfChild function on the view’s parent:
LinearLayout addNoteLayout = (LinearLayout) findViewById(R.id.llAddNote);
int index = ((ViewGroup) addNoteLayout.getParent()).indexOfChild(addNoteLayout);