in Education by
I have a listView in my application and at some point during the execution, I want to highlight a specific row. I found some examples but I keep getting errors. Here is my code: public void animate(int pos){ //pos:position of the row in the list lv1=(ListView)findViewById(R.id.listView1); Animation animation = AnimationUtils.loadAnimation(getBaseContext(), R.anim.scale); ((View)lv1.getItemAtPosition(pos)).startAnimation(animation); } and scale.xml <?xml version="1.0" encoding="utf-8"?> If anyone can help with this I would really appreciate it. EDIT: I want to give an additional information I just found out. I get a NullPointerException when I run the code. Following line causes the exception ((View)lv1.getItemAtPosition(pos)) I cannot get the items in listView. I changed my program as follows: public void animate(int pos){ //pos:position of the row in the list lv1=(ListView)findViewById(R.id.listView1); View v=lv1.getChildAt(pos); Toast.makeText(getBaseContext(),Boolean.toString((v==null)),Toast.LENGTH_SHORT).show(); } It always displays "true". I didn't understand where the problem is stemming from. JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
I'm not sure if this helps you at all, but I found your code useful to me to solve my problem. I got the same type of effect working with the following code: //Animation swipe to the right View view = lv.getChildAt(pos); Animation animation = AnimationUtils.loadAnimation(TaskMain.this, R.anim.slideright); view.startAnimation(animation); Then I just put that in my area when I want to activate it. For myself in particular I activated on gesture.

Related questions

0 votes
    I'm having some problems when trying to remove the header from a listView. At first I use addHeaderView( ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 19, 2022 in Education by JackTerrance
0 votes
    I made a JQuery function the one deletes the row I selected. I know that the option exist in the DataTables option, but I want to ... }*/ });}); Then, I have the JSON file there:...
asked Jul 3, 2022 in Education by JackTerrance
0 votes
    I made a JQuery function the one deletes the row I selected. I know that the option exist in the DataTables option, but I want to ... }*/ });}); Then, I have the JSON file there:...
asked Jun 19, 2022 in Education by JackTerrance
0 votes
    Which are indexed by either row or column using a specific name or number? (a) Datasets (b) Data frames (c ... and Out of R Programming Select the correct answer from above options...
asked Feb 13, 2022 in Education by JackTerrance
0 votes
    In My Activity there are more then one ListView. See the XML Layout of it: Now i am able to ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 19, 2022 in Education by JackTerrance
0 votes
    In My Activity there are more then one ListView. See the XML Layout of it: Now i am able to ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 19, 2022 in Education by JackTerrance
0 votes
    In My Activity there are more then one ListView. See the XML Layout of it: Now i am able to ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 19, 2022 in Education by JackTerrance
0 votes
    In My Activity there are more then one ListView. See the XML Layout of it: Now i am able to ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 16, 2022 in Education by JackTerrance
0 votes
    I am having the code like In which I will bind the value for checkbox dynamically from db at buttonclick ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 7, 2022 in Education by JackTerrance
0 votes
    I am having the code like In which I will bind the value for checkbox dynamically from db at buttonclick ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 5, 2022 in Education by JackTerrance
0 votes
    I'm beeing bit confused here. SimpleCursorAdapter adapter = new SimpleCursorAdapter(this, R.layout.bugs_list_item, ... for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jan 16, 2022 in Education by JackTerrance
0 votes
    I am developing a Windows 8 metro application that uses semantic zoom in the following way: The zoomed in ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jan 13, 2022 in Education by JackTerrance
0 votes
    I am using the Google Sheets V4 Values collection and I am having trouble figuring out how to get each ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 20, 2022 in Education by JackTerrance
0 votes
    been working on some database data calling into a .php file. The php file contains an "Add" button ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 20, 2022 in Education by JackTerrance
0 votes
    I'm using VB code created by L42 on 4/27/14 that creates a checkbox list in a single cell. ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 11, 2022 in Education by JackTerrance
...