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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T12:12:47+00:00 2026-06-10T12:12:47+00:00

I have an activity which invokes an onItemClick and launches another activity. This activity

  • 0

I have an activity which invokes an onItemClick and launches another activity. This activity has a static layout(for testing purposes), but only thing I see is black(I even set the text color to white to check it out).

My listener

 list.setOnItemClickListener(new OnItemClickListener() {

        public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,long arg3) {
            //create new intent
            Intent item = new Intent(getApplicationContext(), Item.class);
            // Close all views before launching logged
            //item.putExtra("name", ((TextView)arg1).getText());
            //item.putExtra("uid", user_id);
            item.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
            startActivity(item);
            // Close Login Screen
            onPause();
        }
      });

My activity is here(not much to do it just launches the layout)

public class Item extends Activity{
protected SQLiteDatabase myDB=null;
protected String name;
protected int uid;
TextView yeart,year,itemname,comment,commentt,value,valuet,curr,currt;


protected void onStart(Bundle savedInstanceState){
    super.onCreate(savedInstanceState);
    setContentView(R.layout.herp);
    /*name=getIntent().getStringExtra("name");
    uid=Integer.parseInt(getIntent().getStringExtra("uid"));

    itemname=(TextView) findViewById(R.id.itemName);//itemname.setText(name);
    year=(TextView) findViewById(R.id.itemYear);
    yeart=(TextView) findViewById(R.id.year);
    comment=(TextView) findViewById(R.id.itemComments);
    commentt=(TextView) findViewById(R.id.comments);
    curr=(TextView) findViewById(R.id.itemcurrent);
    currt=(TextView) findViewById(R.id.current);
    value=(TextView) findViewById(R.id.itemValue);
    valuet=(TextView) findViewById(R.id.value);*/



    Database openHelper = new Database(this);
    myDB = openHelper.getReadableDatabase(); 
    myDB=SQLiteDatabase.openDatabase("data/data/com.example.login2/databases/aeglea", null, SQLiteDatabase.OPEN_READONLY);


}}

And finally my XML layout

 <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

<TextView
        android:id="@+id/itemName"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="asdasd"
        android:gravity="center"
        android:layout_marginBottom="10px"
        android:textAppearance="?android:attr/textAppearanceLarge"
        android:textColor="#fff" />

    <TextView
        android:id="@+id/current"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="Current"
        android:textSize="20dp"
        android:textStyle="bold" />

    <TextView
        android:id="@+id/itemcurrent"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="asdasd" />

    <TextView
        android:id="@+id/year"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="Year"
        android:textSize="20dp"
        android:textStyle="bold" />

    <TextView
        android:id="@+id/itemYear"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="asdasd" />

    <TextView
        android:id="@+id/value"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="Value"
        android:textSize="20dp"
        android:textStyle="bold" />

    <TextView
        android:id="@+id/itemValue"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="TextView" />

    <TextView
        android:id="@+id/comments"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="Comments"
        android:textSize="20dp"
        android:textStyle="bold" />

    <TextView
        android:id="@+id/itemComments"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="TextView" />
</LinearLayout>
  • 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-10T12:12:48+00:00Added an answer on June 10, 2026 at 12:12 pm

    Could you please try this,

    public void onCreate(Bundle savedInstanceState){
        super.onCreate(savedInstanceState);
        setContentView(R.layout.herp);
        /*name=getIntent().getStringExtra("name");
        uid=Integer.parseInt(getIntent().getStringExtra("uid"));
    
        itemname=(TextView) findViewById(R.id.itemName);//itemname.setText(name);
        year=(TextView) findViewById(R.id.itemYear);
        yeart=(TextView) findViewById(R.id.year);
        comment=(TextView) findViewById(R.id.itemComments);
        commentt=(TextView) findViewById(R.id.comments);
        curr=(TextView) findViewById(R.id.itemcurrent);
        currt=(TextView) findViewById(R.id.current);
        value=(TextView) findViewById(R.id.itemValue);
        valuet=(TextView) findViewById(R.id.value);*/
    
    
    
        Database openHelper = new Database(this);
        myDB = openHelper.getReadableDatabase(); 
        myDB=SQLiteDatabase.openDatabase("data/data/com.example.login2/databases/aeglea", null, SQLiteDatabase.OPEN_READONLY);
    
    
    }}
    

    I think you should use onCreate() instead of onStart().

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

Sidebar

Related Questions

I currently have a project in which the main activity launches another activity for
I have a activity which has a button and 2 autocomplete widget. for the
Guys I have an activity which has a home button, when the button is
Here's the scenario I have an activity(A) which has a button and textview. I
i have a activity which extends ListActivity. The Layout contains some generic widget an
In my Android application, I have a fragment activity which it has a progressbar.
hi I have a button which when (pressed) clicked will fire off another activity.
I have an activity which is going to switch around between several views, and
I have an Activity which shows a welcome message if started for the first
I have an activity which shows some List entries. When I click on a

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.