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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T15:32:02+00:00 2026-06-15T15:32:02+00:00

In the beginning: I am new in Android and Java programming, but I have

  • 0

In the beginning: I am new in Android and Java programming, but I have a lot of experience with other programming languages like C, C++, Perl, PerlTk, OpenGL, Pascal, Microcontroller programming (C, Assembly), etc… I took a research and I tried a lot of things but nothing helped.

So I want to change the font size and font color in my listview.
I found 2 solutions:

  1. Hacking the style. This is working, but if I modify my style than I have to modify all the other elements, what is building from this style. So no, and If I choose this method still I wont be able to modify the listview pressed and not pressed state background colors.

  2. Custom layout. I prefer this method, but if I refer the layout, the eclipse says: “cannot be resolve, or is not a field”

My code:

public class Btcall extends Activity 
{
  private ListView list;
  final int REQUEST_ENABLE_BT = 1;
  TextView kiirni;
  TextView scanned;
  View view2;
  View view3;
  Button connectbutton;
  private ArrayAdapter<String> founddevices = null;

  @Override
  protected void onCreate(Bundle savedInstanceState) 
  {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.activity_btcall);
    view2=(View) findViewById(R.id.view2);
    view3=(View) findViewById(R.id.view3);
    connectbutton=(Button) findViewById(R.id.button1);
    kiirni=(TextView)findViewById(R.id.text1);
    scanned=(TextView)findViewById(R.id.scanned);
    list = (ListView) findViewById(R.id.list1);
  }

  public void irddki(View v) 
  {
    BluetoothAdapter bluetooth = null;
    BroadcastReceiver mReceiver = null;
    bluetooth = BluetoothAdapter.getDefaultAdapter();
    founddevices = null;
    if(bluetooth != null)
    {
      String status;
      if (bluetooth.isEnabled()) 
      {
        String mydeviceaddress = bluetooth.getAddress();
        String mydevicename = bluetooth.getName();
        status = mydevicename + " : " + mydeviceaddress;
        Toast.makeText(this, status, Toast.LENGTH_LONG).show();

        bluetooth.startDiscovery(); 
        mReceiver = new BroadcastReceiver() 
        {
          public void onReceive(Context context, Intent intent) 
          {
            String action = intent.getAction();

            if (BluetoothDevice.ACTION_FOUND.equals(action)) 
            {
              BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);

              founddevices.add(device.getName() + "\n" + device.getAddress());
            }
          }
        };
        scanned.setVisibility(View.VISIBLE);
        RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT);
        lp.setMargins(470, 270, 0, 0);
        connectbutton.setLayoutParams(lp);
        connectbutton.setText("Scan again");
        kiirni.setVisibility(View.GONE);
        list.setBackgroundResource(R.color.Lightgrayy);
        list.setVisibility(View.VISIBLE);

        view2.setVisibility(View.VISIBLE);
        view3.setVisibility(View.VISIBLE);
        /*HERE IS THE PROBLEM--->*/
        founddevices = new ArrayAdapter<String>(this, android.R.layout.mylist);
        list = (ListView) findViewById(R.id.list1);
        list.setAdapter(founddevices);

        IntentFilter filter = new IntentFilter(BluetoothDevice.ACTION_FOUND); 
        registerReceiver(mReceiver, filter);
      }
      else
      {
        if (!bluetooth.isEnabled()) 
        {
          Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
          startActivityForResult(enableBtIntent, REQUEST_ENABLE_BT);
        }
      }
    }
  }

  public void close(View v) 
  {
    moveTaskToBack(true);
  }
}

I wrote a custum layout and I put it in the layouts folder, and it is in the R folder too.

Still the Eclipse can’t see it… Maybe I have to import something? I am sure it is a noob Q but I will appreciate the answer.

  • 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-15T15:32:03+00:00Added an answer on June 15, 2026 at 3:32 pm

    Try using just:

    R.layout.mylist
    

    instead of:

    android.R.layout.mylist
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to Java but not to programming. I'm reading the book Beginning Android
I have a thread in java/Android like this: Handler handler = new Handler() {
I am new to android development but in the past few weeks I have
We have been getting a new error in our Android app since beginning of
I have just started studying Android, I have limited java knowledge but am semi
We have a database app that we're beginning to write some new systems for
I'm new to Android programming and could really use some help with a program
Recently, there's a new android SDK- ADT bundle for windows which includes everything but
I'm fairly new to android, but I've noticed that pretty much every tutorial begins
I'm pretty new to android development, so I hope my question is easy, but

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.