Examining separate news from listView on Android
-
Hey, everybody, I'm doing a diploma, and it's a portal, for both the student and the abductors.
The problem is, I have a section of "Novice," getting news through a html password page, then they're added.
listView
♪That's what I'm interested in, how do I make a move to another fragment with more detailed information on this news?
Thank you for the answer!
-
You need to create an event.
OnItemClickListener
Like that.listview.setOnItemClickListener(new OnItemClickListener(){ @Override public void onItemClick(AdapterView<?>adapter,View v, int position){
ItemClicked item = adapter.getItem(position); // тут destinationActivity это куда проходит Intent intent = new Intent(Activity.this,destinationActivity.class); // тут будет переход на ваш фрагмент или активити startActivity(intent); }
});