0

I'm new to android and I think that the question sounds weird,however, I want to implement it. Well, What I want to do is to show a imageView in the buttom of the list view after you scroll down to the bottom of the listview. I have a simple code below. But is it possible to pop up a imageview after the listview is scrolled? Since I'm a noob some pros tip here means a lot to me.

 @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_task_reader);




        updateUI2();
    }



    private void updateUI2() {
        helper = new TaskDBHelper(TaskReader.this);
        SQLiteDatabase sqlDB = helper.getReadableDatabase();
        Cursor cursor = sqlDB.query(TaskContract.TABLE,
                new String[]{TaskContract.Columns._ID, TaskContract.Columns.TASK},
                null, null, null, null, null);

        listAdapter = new SimpleCursorAdapter(
                this,
                R.layout.task_read,
                cursor,
                new String[]{TaskContract.Columns.TASK},
                new int[]{R.id.taskTextRead},
                0
        );

        this.setListAdapter(listAdapter);
    }

//I've added the code in the onCreate however, it seems to not work. The id for the Listview is android:id="@android:id/list" but am I making a mistake?

 list = (ListView)findViewById(android.R.id.list);

        //code to set adapter to populate list
        View footerView =  ((LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE)).inflate(R.layout.footer, null, false);
        list.addFooterView(footerView);
Jennifer
  • 1,822
  • 2
  • 20
  • 45

1 Answers1

0

You can use the ListView.addFooterView(footerView); method of the ListView. It adds a View to the bottom of the ListView.

See this Question: How to add a footer in ListView?

Here you can find the Documentation: http://developer.android.com/reference/android/widget/ListView.html#addFooterView(android.view.View)

Community
  • 1
  • 1
rubengees
  • 1,841
  • 2
  • 16
  • 31