android - Change first row colors of ListView onFetchComplete -


I have a list view that, when loaded from database, onFetchComplete, moves one of the rows to the top of the list . I have worked, but I want to change the background color of the first line and only want to change some text view and background colors of some lines. I'm new to Android, so I'm having trouble finding this problem. Some help would be greatly appreciated

Here's where I change a line:

  @Override FETchComplete (list & lt; application & gt; ) {String myDefault = "3"; // Dismiss the progress dialog if (dialog! = Null) dialog.dismiss (); // Create new adapter ApplicationAdapter adapter = New ApplicationAdapter (this, data); For (int i = 0; i & lt; data.size (); ++ i) {if (data. Get (i) .getAppID (). Equals (myDefault)} {app app = data. Get (i ); Data.remove (i); Data.add (0, app); }} // setListAdapter set the adapter to list the adapter; }  

The listview is being loaded first, then I have tried to make some changes, but when I do this, there are changes in the first and last lines. I'm not sure why it does this; Besides, I'm not sure how to change the background of the entire line.

Here's an example of what I've tried:

  @Override View public getView (int position, seeviewview, ViewGroup parent) {View V = Convertview; If (V == empty) {Layout Inflator Le = Layout Inflator. From (getContext ()); V = li.inflate (R.layout.app_custom_list, null); } App App = Items Received (status); If (app! = Null) {image icon = (image view) v.findViewById (RDICIMIG); TextView title text = (text view) v.findViewById (R.id.titleTxt); TextView descText = (TextView) v.findViewById (R.id.descTxt); TextView creatorText = (TextView) v.findViewById (R.id.creatorTxt); TextView createdtext = (text view) v.findViewById (R.id.createdTxt); TextView rank text = (TextView) v.findViewById (R.id.rankTxt); If (symbol! = Null) {resources res = getContext (). GetResources (); String sIcon = "com.sj.jsondemo: drawable" / + app.getIcon (); Icon.setImageDrawable (res.getDrawable (res.getIdentifier (sIcon, blank, blank)); } If (condition == 0) {if (titleText! = Null) {titleText.setText (app.getTitle ()); TitleText.setBackgroundColor (Color.parseColor ("# E4D0C6")); } If (descText! = Null) descText.setText (app.getDesc ()); If (creatorText! = Null) creatorText.setText (app.getCreator ()); If created (text created! = Zero) the text created .set text (app.getCreated ()); If (Rankite! = Null) rank text. Set text (app.get rank); } Else {if (titleText! = Null) titleText.setText (app.getTitle ()); If (descText! = Tap) descText.setText (app.getDesc ()); If (creatorText! = Null) creatorText.setText (app.getCreator ()); If created (text created! = Zero) the text created .set text (app.getCreated ()); If (Rankite! = Null) rank text. Set text (app.get rank); }} Return V; }  


Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

lua - HowTo create a fuel bar -