Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7815883
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T05:40:07+00:00 2026-06-02T05:40:07+00:00

Here is my code, public class SecondScreenActivity extends Activity { ListView foodJntListView; ArrayList<Restaurent> restaurentData;

  • 0

Here is my code,

public class SecondScreenActivity extends Activity {
ListView foodJntListView;
ArrayList<Restaurent> restaurentData;

@Override
protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    setContentView(R.layout.second_screen);

    restaurentData = getFoodJnt();

    foodJntListView=(ListView)findViewById(R.id.listView_foodjnt);
    foodJntListView.bringToFront();

    // setting the adapter to the list 
    foodJntListView.setAdapter(new RestaurantBaseAdapter(this,restaurentData));

    //setting the onclick listener,activity on clicking on an item of the 
    foodJntListView.setOnItemClickListener(new OnItemClickListener() {

        @Override
        public void onItemClick(AdapterView<?> parent, View view, int position,
                long id) {
            // TODO Auto-generated method stub
            String hotelname=restaurentData.get(position).toString();
             //things to write
        }
    });
}

// get all the list of foodjoints

private ArrayList<Restaurent> getFoodJnt() {
    // TODO Auto-generated method stub
    ArrayList<Restaurent> results=new ArrayList<Restaurent>();

    Restaurent restrnt=new Restaurent();

    restrnt.setFoodJointname("Ashila");
    restrnt.setCuisine("Biriyani,Moughlai");
    restrnt.setAddress("Kolkata,E M Bypass");
    restrnt.setOpenhours("10:00am-10:00pm");
    results.add(restrnt);

    restrnt=new Restaurent();
    restrnt.setFoodJointname("Bhajohori Manna");
    restrnt.setCuisine("Bengali,Chinese");
    restrnt.setAddress("Kolkata,Esplanede");
    restrnt.setOpenhours("10:00am-10:00pm");
    results.add(restrnt);

    restrnt=new Restaurent();
    restrnt.setFoodJointname("Bar B Q");
    restrnt.setCuisine("Bengali,Chinese,Thai");
    restrnt.setAddress("Kolkata,Park Street");
    restrnt.setOpenhours("10:00am-10:00pm");
    results.add(restrnt);

    return results;
}


public void makeAToast(String str) {
    //yet to implement
    Toast toast = Toast.makeText(this, str, Toast.LENGTH_SHORT);
    toast.setGravity(Gravity.CENTER, 0, 0);
    toast.show();
}

I can able to show a customized listview with a bunch of textview on it as it’s item but,I want to get the Name of the restauirants setOnItemClick on the List view.

e.g whenever I click Click on "Bar B Q","calcutta Food Court",it’ll show me only "Bar B Q","calcutta Food Court" not other informations.
thnx in advance.Feel free to if u need anything.

enter image description here"my application screen shot"

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T05:40:08+00:00Added an answer on June 2, 2026 at 5:40 am

    assume you’ve got method like getFoodJointname() in your Restaurent class, you can write the below in your onItemClick():

    String hotelname = restaurentData.get(position).getFoodJointname();
    makeAToast(hotelname);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's the code: public class MenuTabActivity extends TabActivity implements OnTabChangeListener{ @Override protected void onCreate(Bundle
Here's my code: public class MyActivity extends Activity implements View.OnClickListener { private Button mHorizontalButton;
here is my code: public class MainMenuActivity extends Activity implements OnClickListener { public int
Here is the code: public class beautiful extends Activity { ImageView radar = (ImageView)
Here is the code: public class BillingService extends Service implements ServiceConnection { ... @Override
Spinner is not working. Here is my code: public class second extends Activity{ Spinner
here is my code public class SimpleJoglApp extends JFrame { public static void main(String[]
So here's my code : public class SetWritable<T extends Writable> implements Writable { private
Here's my code package net.sourceforge.jwebunit.sample; import net.sourceforge.jwebunit.WebTestCase; public class JWebUnitSearchExample extends WebTestCase { public
I have following code: public class readSensorsData extends Activity implements SensorListener { /** Called

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.