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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T06:49:17+00:00 2026-06-15T06:49:17+00:00

My application uses the standard Master/Detail Flow Activity from Eclipse. I was wondering if

  • 0

My application uses the standard Master/Detail Flow Activity from Eclipse. I was wondering if it’s possible to change the text of some ‘Tasks’, each task is located at the left.

My App

masterData = new ArrayAdapter<MyTasks.taskItem>(getActivity(),
        R.layout.simple_list_item_activated_1,
        R.id.text1,
        MyTasks.ITEMS);
setListAdapter(masterData);

This code adds the Tasks to the Master/Detail Flow, it uses a constants from R.Layout. I can’t change the code, I tried adding this line of code but nothing happens:

android:textColor="#FF0000"

R.layout.simple_list_item_activated_1:

<?xml version="1.0" encoding="utf-8"?>
<!--
     Copyright (C) 2010 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->

<TextView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@android:id/text1"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="?android:attr/activatedBackgroundIndicator"
    android:gravity="center_vertical"
    android:minHeight="?android:attr/listPreferredItemHeightSmall"
    android:paddingLeft="?android:attr/listPreferredItemPaddingLeft"
    android:paddingRight="?android:attr/listPreferredItemPaddingRight"
    android:textAppearance="?android:attr/textAppearanceListItemSmall" />

I also tried making a own xml file (commenttextview.xml):

<?xml version="1.0" encoding="utf-8"?>

    <TextView xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/commenttext"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:textColor="#FF0000"
        android:background="?android:attr/activatedBackgroundIndicator"
        android:gravity="center_vertical"
        android:minHeight="?android:attr/listPreferredItemHeightSmall"
        android:paddingLeft="?android:attr/listPreferredItemPaddingLeft"
        android:paddingRight="?android:attr/listPreferredItemPaddingRight"
        android:textAppearance="?android:attr/textAppearanceListItemSmall" />

But nothing realy works. Can someone help me?

Edit:

I tried this but now I have to combine the two ArrayLists:

    nc_masterData = new ArrayAdapter<MyTasks.taskItem>(getActivity(),
            R.layout.nocommenttextview, R.id.nocommenttext);

    c_masterData = new ArrayAdapter<MyTasks.taskItem>(getActivity(),
            R.layout.commenttextview, R.id.commenttext);



    for (int i = 0; i < MyTasks.ITEMS.size(); i++) {
        if (MyTasks.ITEMS.get(i) != null) {
            if (MyTasks.customers[(Integer.parseInt(MyTasks.ITEMS.get(i).id))][10].equals("0")) {
                nc_masterData.add(MyTasks.ITEMS.get(i));
            }else{
                c_masterData.add(MyTasks.ITEMS.get(i));
            }
        }
    }


    setListAdapter(nc_masterData);
  • 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-15T06:49:19+00:00Added an answer on June 15, 2026 at 6:49 am

    You can try to extend the ArrayAdapter class, and in its getView method, change the color of the TextView.

    Edited to add an example, couldn’t try it but I think it should work.

    public class TestAdapter extends ArrayAdapter<MyTasks.taskItem> {
    
    private int resource;
    private int textViewResourceId;
    private Context context;
    private List<MyTasks.taskItem> objects;
    
    public TestAdapter(Context context, int resource, int textViewResourceId, List<MyTasks.taskItem> objects) 
    {
        super(context, resource, textViewResourceId, objects);
        this.context = context;
        this.resource = resource;
        this.textViewResourceId = textViewResourceId;
        this.objects = objects;
    }
    
    @Override
    public View getView(int position, View convertView, ViewGroup parent)
    {
        LayoutInflater vi = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    
        View view = vi.inflate(resource, null);
        TextView tv = (TextView) view.findViewById(textViewResourceId);
        tv.setText(objects.get(position).toString()); //Not sure about taskItem class toString
        tv.setTextColor(Color.parseColor("#FF0000"));
    
        return view;
    }
    

    }

    And then in your main class:

    masterData = new TestAdapter<MyTasks.taskItem>(getActivity(),
        R.layout.simple_list_item_activated_1,
        R.id.text1,
        MyTasks.ITEMS);
    
    setListAdapter(masterData);
    

    You should take a look into the ViewHolder pattern in order to make the adapter more effective.

    Hope that helps!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm developing a CakePHP application which uses the standard CakePHP URL schema. If I
I am building an MVC 3 application which uses the standard Model validation attributes
I am trying to make a application that uses the standard Split View Application
I have a pretty standard .NET MVC 3 application that uses Ninject for dependency
My application uses a 3rd party dll. If I remove myapp.exe.local file from my
My application uses MS access database to save some sensitive information. Though that information
My Windows Forms application uses the following standard line of code so that visual
I have a asp.net mvc web application an it uses some favicon.ico. Now when
I have one application which uses the standard .NET forms authentication cookie, now I
I have a standard web application deployed to an application server. The application uses

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.