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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T04:14:03+00:00 2026-06-10T04:14:03+00:00

I got an app that include listview and i want the first line of

  • 0

I got an app that include listview and i want the first line of the listview in blue.
i did the listview from an array xml here is the code&XML:
JAVA:

public class MainActivity extends Activity implements OnItemClickListener {
 ListView list;
 ArrayAdapter<String> adaptr;

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    list = (ListView) findViewById(R.id.listView1);
    adaptr = new ArrayAdapter<String>(this,
            android.R.layout.simple_list_item_1
            , getResources().getStringArray(R.array.list_view));
    list.setAdapter(adaptr);
    list.setOnItemClickListener(this);
    list.setFastScrollEnabled(true);

}  

public void onItemClick(AdapterView<?> adapterView, View view, int position, long id) {
    Dialog dialog1 = new Dialog(this, R.style.PauseDialog);
    dialog1.setContentView(R.layout.dialog1);
    TextView text = (TextView) dialog1.findViewById(R.id.tv1);
    dialog1.setTitle(R.string.Title);

    if(position == 1) {
        text.setText("First Dialog");
        dialog1.show();
        }
    if(position == 2) {
        text.setText("Second Dialog");
        dialog1.show();
        return;
        }   
    if(position == 3) {
        text.setText("Third Dialog");
        dialog1.show();
        return;
        }
}

here is the XML:

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <array name="list_view"> 
      <item>All Rights Saved to XXX</item>
      <item>Line 1</item>
      <item>Line 2</item>   
      <item>Line 3</item>
    </array> 
</resources>

i want the first item(“All Rghits….”) will be in blue(color)
(and the other will be regular(black))

  • 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-10T04:14:04+00:00Added an answer on June 10, 2026 at 4:14 am

    You could programmatically add a HeaderView using listView.addheaderView .
    You can change the View color to blue

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

Sidebar

Related Questions

I've got a Rails 3.2.1 app that I'm trying to include some jquery in.
We've got an app with some legacy printer setup code that we are still
I'm developing an iPhone app. I've got a function that reads data from a
I'm c++ newbie. My first app looks like that. #include stdafx.h #include <iostream> using
I got an app that loads images into the Zimage(graphcontrol). One issue I am
I got an app that links to boost_program_options, whose CMakeLists.txt looks like FIND_PACKAGE(Boost COMPONENTS
I've got an app that has all content regardless of language displaying content in
I've got an app that exports an AVMutableComposition into a .mov file, and I'd
I've got an app that will be doing a fair amount of communication with
I've got an app that's working pretty flawlessly in Chrome and FF, however, when

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.