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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T03:11:21+00:00 2026-06-04T03:11:21+00:00

I m getting error at setcontentview, its not taking layout main.Resource file is doesn’t

  • 0

I m getting error at setcontentview, its not taking layout main.Resource file is doesn’t created can anybody solve my problem.

here is my code for main screen.

SqlitetestActivity.java file

public class SqlitetestActivity extends ListActivity {
protected EditText searchText;
protected SQLiteDatabase db;
protected Cursor cursor;  
protected ListAdapter adapter;

public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    searchText = (EditText) findViewById(R.id.searchText);
    db = (new DatabaseHelper(this)).getWritableDatabase();
}

public void onListItemClick(ListView parent, View view, int position, long id) {
    Intent intent = new Intent(this, StudentDetails.class);
    Cursor cursor = (Cursor) adapter.getItem(position);
    intent.putExtra("EMPLOYEE_ID", cursor.getInt(cursor.getColumnIndex("_id")));
    startActivity(intent);
}

public void search(View view) {
    // || is the concatenation operation in SQLite
    cursor = db.rawQuery("SELECT _id, firstName, lastName, title FROM employee WHERE firstName || ' ' || lastName LIKE ?", 
                    new String[]{"%" + searchText.getText().toString() + "%"});
    adapter = new SimpleCursorAdapter(
            this, 
            R.layout.employee_list_item, 
            cursor, 
            new String[] {"firstName", "lastName", "title"}, 
            new int[] {R.id.firstName, R.id.lastName, R.id.title});
    setListAdapter(adapter);
}

}

my main.xml

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" 
android:paddingTop="4dp">

<include android:id="@+id/search" layout="@layout/search" />

<ListView
    android:id="@android:id/list"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:layout_below="@id/search"
    android:drawSelectorOnTop="false"/>

</RelativeLayout>

I have tried restarting eclipse.. this doest work. any able to solve this problem. please insist me.. thanks in adbvance

  • 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-04T03:11:22+00:00Added an answer on June 4, 2026 at 3:11 am

    Just take 2 steps and problem would be more likely to get solved:

    Step 1: Clean your project by clicking Project -> Clean.

    Step 2: Rebuild your project by clicking Project -> Build All.

    Also make sure that your layout xml files are syntax error free and you don’t have any image which has non-acceptable names (such as a “-” between image name).

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

Sidebar

Related Questions

Below is my program and I am getting this error: Description Resource Path Location
I am getting the error 'Unable to open stack trace file '/data/anr/traces.txt': Permission denied'
getting error while try to start service
Getting error when I tried like this: $ci =& get_instance(); $ci->db->select(CONCAT_WS(' ',users.name_first,users.name_last) AS user_name,CONCAT_WS('
Getting error while inserting values into database (SQL Server 2008) Implicit conversion from data
Update getting error when i try to call the method from Activity: SQLiteDatabase db
I am getting error trying to run my asp code for executing stored proc.
I'm getting error: Unrecognised selector sent to instance, upon inspection, I see there is
I am getting Error in submitting the form using AJAX and Jquery, following is
I am getting error of System.MissingMethodException after I have an optional parameter in one

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.