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 8936693
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T10:16:13+00:00 2026-06-15T10:16:13+00:00

Here’s my my_lifts_list.xml: <?xml version=1.0 encoding=utf-8?> <RelativeLayout xmlns:android=http://schemas.android.com/apk/res/android android:layout_width=wrap_content android:layout_height=wrap_content android:orientation=vertical android:background=@drawable/white_linen> <LinearLayout android:id=@+id/bottom_control_bar

  • 0

Here’s my my_lifts_list.xml:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
 xmlns:android="http://schemas.android.com/apk/res/android"
 android:layout_width="wrap_content" 
 android:layout_height="wrap_content"
    android:orientation="vertical"
 android:background="@drawable/white_linen">

    <LinearLayout android:id="@+id/bottom_control_bar"
        android:layout_width="fill_parent" android:layout_height="wrap_content"
        android:layout_alignParentBottom="true">
        <Button android:id="@+id/bookButton" android:layout_width="fill_parent"
            android:layout_height="wrap_content" android:text="@string/bookRide"
            android:onClick="bookRide"/>
    </LinearLayout>

   <ListView 
      android:id="@+id/android:list" 
      android:layout_width="fill_parent"
        android:layout_height="0dip"
        android:layout_above="@id/bottom_control_bar"
      android:divider="#b5b5b5"
      android:dividerHeight="3dp"
      android:listSelector="@drawable/custom_list_selector"/>
   <TextView
    android:id="@+id/android:empty"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" 
    android:text="You have not joined any rides."/>     
</RelativeLayout>

Here’s my fragment activity:

public class LiftActivity extends FragmentActivity {

    private static final String TAG = LiftActivity.class.getName();

    private ArrayList<Lift> mLifts = new ArrayList<Lift>();

    private LiftArrayAdapter mAdapter;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.my_lift_list);

        mAdapter = new LiftArrayAdapter(this, R.layout.ride_item_card, mLifts);

        FragmentManager     fm = getSupportFragmentManager();
        FragmentTransaction ft = fm.beginTransaction();

        LiftListFragment list = new LiftListFragment();
        ft.add(android.R.id.content, list);

        list.setListAdapter(mAdapter);

        MyLiftsResponderFragment responder = (MyLiftsResponderFragment) fm.findFragmentByTag("RESTResponder");

        if (responder == null) {
            responder = new MyLiftsResponderFragment(); 
            ft.add(responder, "RESTResponder");
        }

        ft.commit();
    }

    public void bookRide(View v){
        Intent intent = new Intent(this, LiftSearchActivity.class);
        startActivity(intent);
    }

    public LiftArrayAdapter getArrayAdapter() {
        return mAdapter;
    }
}

my liftlistfragment :

public class LiftListFragment extends ListFragment {

    private static final String TAG = LiftListFragment.class.getName();

    private static final int ACTIVITY_VIEW_LIFT = 0;


    @Override
    public void onListItemClick(ListView list, View v, int position, long id) {
        Lift item = (Lift) getListAdapter().getItem(position);
        Intent intent = new Intent(this.getActivity(), LiftDetailActivity.class);
        intent.putExtra("lift", item.getId());
        intent.putExtra("time", item.getTime());
        intent.putExtra("price", item.getPrice());
        startActivity(intent);
    }

}

And finally, my lift list adapter:

public class LiftArrayAdapter extends ArrayAdapter<Lift> {

    private final ArrayList<Lift> lifts;

    public LiftArrayAdapter(Context context, int textViewResourceId, ArrayList<Lift> results) {
        super(context, textViewResourceId, results);
        this.lifts = results;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        // assign the view we are converting to a local variable
        View v = convertView;

        // first check to see if the view is null. if so, we have to inflate it.
        // to inflate it basically means to render, or show, the view.
        if (v == null) {
            LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            v = inflater.inflate(R.layout.ride_item_card, null);
        }

        Lift i = lifts.get(position);

        if (i != null) {

            ImageView imageView = (ImageView) v.findViewById(R.id.list_image);

            TextView departureDate = (TextView) v.findViewById(R.id.departureDate);
            TextView driverName = (TextView) v.findViewById(R.id.driverName);
            TextView placesRemaining = (TextView) v.findViewById(R.id.placesRemaining);
            TextView ridePrice = (TextView) v.findViewById(R.id.ridePrice);

            imageView.setTag(i.getDriver().getImage());

            ImageLoader image = new ImageLoader();
            image.execute(imageView);

            if (departureDate != null){
                departureDate.setText(i.getFrom().getDescription() + " vers " + i.getTo().getDescription());
            }
            if (driverName != null){
                driverName.setText(i.getTime());
            }
            if (placesRemaining != null){
                placesRemaining.setText("Places remaining : " + Integer.toString(i.getCapacity() - i.getPassengers().size()));
            }
            if (ridePrice != null){
                ridePrice.setText("$" + Float.toString(i.getPrice()));

            }
        }

        // the view must be returned to our activity
        return v;

    }
}

So basically, I have my list of items (which can be clicked) and my button at the bottom that is unclickable.

I don’t understand why I can’t get this button working. If I use the keyboard I can select it. I presume it has to be some fragment issues the onclicklistener usage between my listfragment and my activityfragment (so, probably my button act as an item). is there a better way to implement this?

  • 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-15T10:16:14+00:00Added an answer on June 15, 2026 at 10:16 am

    You set the layout file for your activity but then you add your LiftListFragment fragment directly to the FragmentActivitiy‘s content Framelayout(which has the id android.R.id.content) which will cover the entire previously set layout. Are you sure you don’t want the LiftListFragment added in the my_lifts_list.xml layout file like this?:

    <RelativeLayout>
       // the button part
       <FrameLayout android:id="@+id/liftfrag_wrapper" android:layout_above="@id/the_button" // other attributes/>
    </RelativeLayout>
    

    Then in your code:

    ft.add(R.id.liftfrag_wrapper, list);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is my persistence.xml : <?xml version=1.0 encoding=UTF-8?> <persistence xmlns=http://java.sun.com/xml/ns/persistence xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xsi:schemaLocation=http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd version=1.0>
Here's my code in the <head></head> : <link rel=stylesheet href=http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css /> <script type=text/javascript src=http://code.jquery.com/jquery-1.7.1.min.js></script>
here is my configuration: http://domain.com (obviously fictitious name...) hosted on a server running Apache
Here's a piece of code I copied from http://www.schillmania.com/content/projects/javascript-animation-1/demo/ Very simple JS animation: function
Here is my code, which takes two version identifiers in the form 1, 5,
Here's the two scenarios. We are using a manually built xml soap request with
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
Here is a XML: <mesh> <triangles material=face count=990> <input semantic=VERTEX source=#boyShape-skin-vertices offset=0/> <input semantic=NORMAL
Here is a small demonstration of what my problem is: http://jsfiddle.net/k2Pqw/4/ After sizing the
Here's the view: @if (stream.StreamSourceId == 1) { <img class=source src=@Url.Content(~/Public/assets/images/own3dlogo.png) alt= /> }

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.