i am new to android, i am developing an app similar to Notepad. My notepad files are saved in the form of ListView, where the listview contains a TextView and a button. Button is for delete option to remove data from the database, which it is working successfully, but the problem is with the TextView, my intention is when a user clicks any file in the listview (i.e.,TextView), i want to open that file without losing previous data written in notepad, so that he can update the data. Any help is appreciated.
This is my java file,
public void deleteTask(View view) {
View parent = (View) view.getParent();
TextView taskTextView = (TextView) parent.findViewById(R.id.task_title);
String task = String.valueOf(taskTextView.getText());
SQLiteDatabase db = mHelper.getWritableDatabase();
db.delete(TaskContract.TaskEntry.TABLE,
TaskContract.TaskEntry.COL_TASK_TITLE + " = ?",
new String[]{task});
db.close();
updateUI();
}
and
public void click(View view) {
View parent = (View) view.getParent();
TextView taskTextView = (TextView) parent.findViewById(R.id.task_title);
String task = String.valueOf(taskTextView.getText());
SQLiteDatabase db = mHelper.getReadableDatabase();
db.openDatabase( getDatabasePath(task), SQLiteDatabase.CursorFactory null,int flags);
Intent intent = new Intent(getApplicationContext(), MainActivity.class);
startActivity(intent);
}
This is my xml file
<TextView
android:id="#+id/task_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:text="#string/app_name"
android:textSize="20sp"
android:onClick="click"/>
<Button
android:id="#+id/task_delete"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:text="Delete"
android:onClick="deleteTask"/>
and another xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="#dimen/activity_vertical_margin"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin"
tools:context="com.example.shiva.secretbook.TodoList">
<ListView
android:id="#+id/list_todo"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
I think this code is enough to solve my question. Thanks in advance
Related
I have a big SQLite database (7000+ items) with 16 columns per row. I would like to populate my custom recycler view, that I already made, with items from the database to make a huge recycler view list.
My question is this: How would you go about iterating through 2 entire columns of all of the rows. I need to fetch a name and an ID of each and every single item in the database and assign those values to 2 text views, that I created through a custom recycler view adapter. I already have a method in the database that returns a number of total rows (aka items) in a database. I would like to make a loop with i < getDbSize(); but I don't have a clear idea on how I would go about on incrementing through 2 particular columns of all rows and then applying that information onto a card in the recycler view.
Here is the xml code where recycler view sits:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".CollegeFragment"
android:background="#color/colorPrimaryDark">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="center"
android:padding="10dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="College Search Tool"
android:textSize="28sp"
android:padding="10dp"
android:textColor="#color/colorWhite"
android:fontFamily="sans-serif-medium"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="#drawable/grad_bg"
android:paddingBottom="10dp"
android:paddingRight="10dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingTop="10dp"
android:paddingLeft="10dp"
android:paddingRight="10dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="ipeds id:"
android:textSize="24sp"
android:padding="10dp"
android:textColor="#color/colorWhite"
android:fontFamily="sans-serif-medium"/>
<EditText
android:id="#+id/et_ipeds"
android:layout_width="match_parent"
android:layout_height="40dp"
android:textColor="#color/colorWhite"
android:fontFamily="sans-serif-medium"
android:paddingLeft="15dp"
android:paddingRight="15dp"
android:background="#drawable/et_alt1_bg"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingTop="10dp"
android:paddingLeft="10dp"
android:paddingRight="10dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="name: "
android:textSize="24sp"
android:padding="10dp"
android:textColor="#color/colorWhite"
android:fontFamily="sans-serif-medium"/>
<EditText
android:id="#+id/et_name"
android:layout_width="match_parent"
android:layout_height="40dp"
android:textColor="#color/colorWhite"
android:fontFamily="sans-serif-medium"
android:paddingLeft="15dp"
android:paddingRight="15dp"
android:background="#drawable/et_alt1_bg"/>
</LinearLayout>
</LinearLayout>
<TextView
android:layout_marginTop="10dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="RESULT"
android:textSize="28sp"
android:padding="10dp"
android:textColor="#color/colorWhite"
android:fontFamily="sans-serif-medium"/>
<androidx.recyclerview.widget.RecyclerView
android:id="#+id/recycler"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#android:color/darker_gray"/>
</LinearLayout>
</FrameLayout>
and Java:
public class CollegeFragment extends Fragment implements ItemClickListener{
private RecyclerView recyclerView;
private CustomRecyclerAdapter customRecyclerAdapter;
private List<CollegeItem> collegeItemList = new ArrayList<>();
private DatabaseCollege dbCollege;
#Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View myFragmentView = inflater.inflate(R.layout.fragment_college, container, false);
dbCollege = new DatabaseCollege(getActivity());
recyclerView = myFragmentView.findViewById(R.id.recycler);
customRecyclerAdapter = new CustomRecyclerAdapter(collegeItemList, getActivity());
RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(getActivity(), LinearLayoutManager.VERTICAL, false);
recyclerView.setLayoutManager(layoutManager);
recyclerView.setItemAnimator(new DefaultItemAnimator());
recyclerView.setAdapter(customRecyclerAdapter);
customRecyclerAdapter.setItemClickListener(this);
//populate collegeItemList with dummy values for testing
String name = "College 1";
String id = "12345647653";
String name2 = "College 2";
String id2 = "12345";
CollegeItem college = new CollegeItem(name, id);
CollegeItem college2 = new CollegeItem(name2, id2);
collegeItemList.add(college);
collegeItemList.add(college2);
return myFragmentView;
}
#Override
public void onClick(View v, int position) {
String name = collegeItemList.get(position).getName();
String id = collegeItemList.get(position).getId();
}
public void populateList() {
int numOfColleges = dbCollege.getNumOfColleges();
for(int i = 0; i < numOfColleges; i++) {
//read in data from database into collegeItemList recyclerView here
}
}
}
I also included a picture with what I am trying to achieve that contains manually inserted variables. I basically want to populate that list with cards that each contain info(ID and name) about each and every item from database.
You need to query the database first to get those two fields like below:
ArrayList<CollegeItem> arr = new ArrayList<>();
String selectQuery = "SELECT * FROM " + TABLE_NAME;
SQLiteDatabase db = this.getReadableDatabase();
Cursor cursor = db.rawQuery(selectQuery, null);
// Move to first row
cursor.moveToFirst();
while (cursor.isAfterLast() == false)
{
arr.add(new CollegeItem(cursor.getString(1),
cursor.getString(2));
cursor.moveToNext();
}
cursor.close();
db.close();
return arr;
Then pass this ArrayList(arr) to the list view using Adaptor and map the values of Pair class to the XML components.
I'm trying to create a 'favourites' view dynamically in android by recording whether the user has favoured a specific sound bite in my app and then inserting the sub view into a parent view with the appropriate info about a particular soundbite. Essentially, creating a custom playlist of soundbites.
I'm having problems with the layoutInflator though. If I add more than one sub view into my parent view, only the last sub view added will have the appropriate parameters entered, whereas the rest have the default values from the sub view xml layout.
Here is my java code displaying the general idea behind adding subviews:
LayoutInflater l = getLayoutInflater();
LinearLayout ll = (LinearLayout)findViewById(R.id.favlist);
if(getIntent().getExtras()!=null)
{
Bundle extras = getIntent().getExtras();
Intent test = getIntent();
if(test.hasExtra("favThunder")){
String favValues = extras.getString("favThunder");
View v = l.inflate(R.layout.sublayout, null);
ll.addView(v);
ImageView favImage = (ImageView)findViewById(R.id.favimage);
favImage.setImageResource(R.drawable.thundercats);
TextView tv = (TextView) findViewById(R.id.favtitle);
tv.setText(R.string.thundercats);
TextView tvClicks = (TextView) findViewById(R.id.timesplayed);
tvClicks.setText("Times played: " + favValues);
favImage.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
if (mp.isPlaying()) {
mp.stop();
}
mp = MediaPlayer.create(getApplicationContext(), R.raw.thunder);
mp.start();
}
});
}
if(test.hasExtra("favSkeletor")){
String favValues = extras.getString("favSkeletor");
View v = l.inflate(R.layout.sublayout, null);
ll.addView(v);
ImageView favImage = (ImageView)findViewById(R.id.favimage);
favImage.setImageResource(R.drawable.skeletor);
TextView tv = (TextView) findViewById(R.id.favtitle);
tv.setText(R.string.skeletor);
TextView tvClicks = (TextView) findViewById(R.id.timesplayed);
tvClicks.setText("Times played: "+favValues);
favImage.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
if (mp.isPlaying()) {
mp.stop();
}
mp = MediaPlayer.create(getApplicationContext(), R.raw.skeletor);
mp.start();
}
});
}
And here is my sub view and parent view xml respectively
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ImageButton
android:id="#+id/favimage"
android:layout_width="0dp"
android:layout_weight="0.5"
android:layout_height="200dp"
android:src="#drawable/thundercats"
android:scaleType="fitCenter"/>
<LinearLayout
android:layout_weight="0.5"
android:layout_width="0dp"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="#+id/favtitle"
android:layout_weight="0.4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="A TEST TITLE"/>
<TextView
android:layout_weight="0.3"
android:id="#+id/timesplayed"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Times played: Heck!"/>
</LinearLayout>
</LinearLayout>
Parent xml
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
tools:context="com.example.markohare.ohareb00716779_cw1.MainActivity"
>
<LinearLayout
android:id="#+id/favlist"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="5dp">
</LinearLayout>
</ScrollView>
What am I doing wrong? Is my subview too complex or is there something wrong in my java code?
Thanks
Firstly, I'm extremely unsure on the majority of Android coding, this is only my second day doing it, so please excuse any mistakes I make in my explanations!
I've got a database via SQLite and currently display my data via a listView. Currently, it works fine displaying the data and I can scroll through and click on it no issues. However, I'd like to place my data within the "Scrolling Activity" template you can find in Android Studio. From Googling around, I understand somewhat that you can't place a listView in a nestedScrollView, which is what the activity uses.
I am unsure, however, how to display my data from the database without using a listView. Could somebody please help me either convert the listView into something compatible, or explain a way to combine them (Hacky methods are fine for now!)
I've displayed all of the necessary code below.
MainActivity.java:
mydb = new DBHelper(this);
ArrayList array_list = mydb.getAllCotacts();
ArrayAdapter arrayAdapter=new ArrayAdapter(this,android.R.layout.simple_list_item_1, array_list);
obj = (ListView)findViewById(R.id.listView1);
TextView emptyText = (TextView)findViewById(android.R.id.empty);
obj.setEmptyView(emptyText);
obj.setAdapter(arrayAdapter);
obj.setOnItemClickListener(new OnItemClickListener(){
#Override
public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,long arg3) {
// TODO Auto-generated method stub
int id_To_Search = arg2 + 1;
Bundle dataBundle = new Bundle();
dataBundle.putInt("id", id_To_Search);
Intent intent = new Intent(getApplicationContext(),DisplayContact.class);
intent.putExtras(dataBundle);
startActivity(intent);
}
});
content_scrolling.xml:
<android.support.v4.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="#string/appbar_scrolling_view_behavior"
tools:context="uk.ac.tees.q5065885.diary.ScrollingActivity"
tools:showIn="#layout/activity_scrolling">
<android.support.v7.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="match_parent">
<ListView
android:id="#+id/listView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
/>
</android.support.v7.widget.LinearLayoutCompat>
<TextView
android:id="#android:id/empty"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="#string/emptyText"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
/>
</android.support.v4.widget.NestedScrollView>
Apologies for any mistakes, as I say, this is my second day; I'm learning as quick as I can!
You can create views programmatically and add them to LinearLayout on the fly. You can use any kind of view, but in this example I wanted to keep things clear so I assumed that your contacts are Strings and you want to just show them as TextViews. You can try something like this:
mydb = new DBHelper(this);
List<String> contacts = mydb.getAllCotacts();
LinearLayout linearLayout = (LinearLayout) findViewById(R.id.linear_layout);
for(String data : contacts) {
//Create a view for an LinearLayout
TextView textView = new TextView(this);
//Do whatever you like with a view - add listener, adjust style, add text etc.
textView.setOnClickListener(...);
textView.setText(data);
textView.setGravity(Gravity.CENTER);
//Add textView to linearLayout
linearLayout.addView(textView);
}
xml (not very pretty, customize it if you like :))
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.NestedScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="#string/appbar_scrolling_view_behavior"
tools:context="uk.ac.tees.q5065885.diary.ScrollingActivity"
tools:showIn="#layout/activity_scrolling">
<LinearLayout android:layout_height="wrap_content"
android:layout_width="match_parent"
android:id="#+id/linear_layout"
android:orientation="vertical"/>
</android.support.v4.widget.NestedScrollView>
I made this dialog for my app that shows up allows you to delete the items from db. It used to be a textView and a button which called the function, all in a linear layout, which worked good. Now I changed to a Relative Layout so I could add another button on the same line as the other, I also added an editText.
My problem is that since I added those objects I am not able to see the buttons anymore. the editText and textView are visible.
XML Code:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/dialog_deletefood"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="#dimen/activity_vertical_margin"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin"
tools:context="com.example.paulcosma.app2.SecondActivity">
<TextView
android:text="TextView"
android:layout_gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/lblFoodDetails"
android:textAlignment="center"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="19dp" />
<Button
android:text="Şterge"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/btnDeleteEatenFood"
android:layout_alignBaseline="#+id/btnModifyEatenFood"
android:layout_alignBottom="#+id/btnModifyEatenFood"
android:layout_toStartOf="#+id/lblFoodDetails"
android:visibility="visible" />
<Button
android:layout_marginTop="100dp"
android:text="Modifică"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/btnModifyEatenFood"
android:layout_below="#+id/lblFoodDetails"
android:layout_toEndOf="#+id/lblFoodDetails"
android:visibility="visible" />
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ems="10"
android:id="#+id/txtEditValue"
android:maxLength="6"
style="#style/Widget.AppCompat.AutoCompleteTextView"
android:maxLines="1"
android:textAppearance="#style/TextAppearance.AppCompat"
android:fontFamily="sans-serif"
android:textSize="14sp"
android:textAlignment="center"
android:textColorLink="#android:color/holo_blue_light"
android:inputType="numberDecimal"
android:layout_marginTop="21dp"
android:layout_below="#+id/lblFoodDetails"
android:layout_centerHorizontal="true" />
</RelativeLayout>
This dialog is supposed to show on listView item click. Below is the code I used to show it.
#Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
HashMap<String, String> hmap = (HashMap<String, String>)parent.getItemAtPosition(position);
final String _name = hmap.get("food");
final int _id = foodDB.getFoodId(_name);
AlertDialog.Builder mBuiler = new AlertDialog.Builder(SecondActivity.this);
View mView = getLayoutInflater().inflate(R.layout.dialog_deletefood,null);
final TextView lblFoodDetails = (TextView) mView.findViewById(R.id.lblFoodDetails);
final Button btnDeleteEatenFood = (Button) mView.findViewById(R.id.btnDeleteEatenFood);
lblFoodDetails.setText("Aţi ales produsul " + _name + ". Aici puteţi adăuga sau scădea cantitatea printr-o anumită valoare sau puteţi şterge apariţia produsului.");
mBuiler.setView(mView);
final AlertDialog dialog = mBuiler.create();
btnDeleteEatenFood.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
foodDB.deleteEatenFood(_id);
Toast.makeText(SecondActivity.this,_name+" a fost sters",Toast.LENGTH_SHORT).show();
dialog.dismiss();
updateFoodList(foodDB.getAllEatenFood());
}
});
dialog.show();
}
This layout file renders the buttons in the Android layout designer as described (see below)
The problem may reside in code.
The problem was that both buttons where placed based on textView's size. When it changed, buttons got placed out of the screen
Bug:
android:layout_toEndOf="#+id/lblFoodDetails"
android:layout_toEStartOf="#+id/lblFoodDetails"
I have a database and a method, which can get all my info from my database to a TextView. It shows only the Title of each row, there are more columns, which I want to show on new Intent when I click on a Title. My question is, how can I make each title clickable and if clicked it opens up a new intent with the relevant information(need to pass the id)? Many thanks. :)
My History Activity -
public class HistoryActivity extends Activity {
#Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.history_layout);
final LinearLayout linearLayoutBackground = (LinearLayout) findViewById(R.id.MainLinearLayout);
TextView tv = (TextView) findViewById(R.id.tvHistory);
DataBaseHelper DataBaseHelper = new DataBaseHelper(this);
Intent mIntent = getIntent();
int intValue = mIntent.getIntExtra("intVariableName", 0);
int backgroundImages[] = {R.drawable.background1,
R.drawable.background2};
final Drawable backgroundImage = getResources().getDrawable(
backgroundImages[intValue]);
linearLayoutBackground.setBackgroundDrawable(backgroundImage);
DataBaseHelper.open();
String HistoryData = DataBaseHelper.getListData();
DataBaseHelper.closee();
tv.setText(HistoryData);
}
}
getListData method -
public String getListData() {
open();
Cursor c = myDataBase.query(TABLE_NAME1, columns, WHATTODONOW_COLUMN_ID, null, null, null, null);
String result = "";
int iTitle = c.getColumnIndex(WHATTODONOW_COLUMN_TITLE);
for (c.moveToFirst(); !c.isAfterLast(); c.moveToNext()) {
result = result + c.getString(iTitle) + "\n";
}
return result;
}
HistoryLayout -
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/MainLinearLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TableLayout
android:id="#+id/tableLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:paddingLeft="15dp"
android:paddingRight="15dp"
android:paddingTop="10dp">>
<TableRow>
<TextView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:gravity="center"
android:text="All the things you have already done!"
android:textSize="20dp"
android:textStyle="bold">
</TextView>
</TableRow>
</TableLayout>
<ScrollView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:paddingBottom="15dp"
android:paddingLeft="15dp"
android:paddingRight="15dp">
<TextView
android:id="#+id/tvHistory"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center"
android:text="get info from db"
android:paddingBottom="10dp"
android:textSize="25dp">
</TextView>
</ScrollView>
</LinearLayout>
There are two ways to go from my experience. First instead of using a ListView you look at ExpandableListView, which might accomplish what you want in one activity instead of having to start another intent.
Second, if you want to stick with the 2 intent design you have to pass some data from the current intent to the new one, you could do something like:
Intent i = new Intent(yourcurrentactivity.this, yournewactivity.class);
// following line is an example of passing data to the new intent.
i.putExtra(getString(R.string.str_selecteddialog), "1");
startActivity(i);
this.finish();
In the new intent that you have started in the onCreate you need to retrieve the data from the bundle:
Bundle extras = getIntent().getExtras();
if (extras != null) {
// Log.i(TAG, " 022:... we got some extras");
str_selecteddialog = getIntent().getStringExtra(getString(R.string.str_selecteddialog));
There are different types of put and get 'Extras' dependent on variable types. Now you have to decide: Do I get all the data from the cursor and pass it to this new intent or Do I just pass the row id column, typically '_id' and query it in this activity.
Hope this helps.