I created ListView activity to list some data retrieved from server.
Here is that ListAtmActivity.
public class ListAtmActivity extends ListActivity{
private static String url ="http://10.0.2.2:8080/hello/AvailabilityResponse";
private static final String ATM_NO = "atmbrno";
private static final String ATM_PLACE = "atmbrname";
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.list_item);
String brName=getIntent().getExtras().getString("key");
// Hashmap for ListView
ArrayList<HashMap<String, String>> contactList = new ArrayList<HashMap<String, String>>();
// Creating JSON Parser instance
JSONParser jParser = new JSONParser();
// getting JSON string from URL
JSONArray contacts = jParser.getJSONFromUrl(url,brName);
try{
for(int i = 0; i < contacts.length(); i++){
JSONObject json_data = contacts.getJSONObject(i);
// Storing each json item in variable
String atm_id = json_data.getString(ATM_NO);
String atm_name = json_data.getString(ATM_PLACE);
HashMap<String, String> map = new HashMap<String, String>();
map.put(ATM_NO, atm_id);
map.put(ATM_PLACE, atm_name);
contactList.add(map);
}
}
catch(JSONException e) {
e.printStackTrace();
}
/**
* Updating parsed JSON data into ListView
* */
ListAdapter adapter = new SimpleAdapter(this, contactList,
R.layout.list_main,
new String[] { ATM_NO, ATM_PLACE }, new int[] {
R.id.name , R.id.email });
setListAdapter(adapter);
//setContentView(R.layout.list_main);
}}
My contact array is like this.
{"atmbrname":"ANURADAPURA [ATM 2]","atmbrno":"ATM084"},
{"atmbrname":"MANNAR BRANCH ","atmbrno":"ATM344"}
Here my two xml file also.
list_item.xml
<?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" >
<ListView android:id="#android:id/list"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
</LinearLayout>
list_main.xml
<?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" >
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<!-- Name Label -->
<TextView
android:id="#+id/name"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textColor="#43bd00"
android:textSize="16sp"
android:textStyle="bold"
android:paddingTop="6dip"
android:paddingBottom="2dip" />
<!-- Description label -->
<TextView
android:id="#+id/email"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textColor="#acacac"
android:paddingBottom="2dip">
</TextView>
</LinearLayout>
But I can't get list view. No errors came. I think problem with my xml files. can anyone help me to solve this problem..
I would try to set the height to "match_parent". But not sure if that fixes your problem.
I only had problems with ListActivity, therefore I am using always a normal Activity and retrieve the ListView from the Contentview of the activity.
Related
Whatever I set ListView attribute,it has a empty line at the top,I can't get rid of,I find many methods,but can't figure it out.My environment is in Android 4.1,so please help,thanks in advance.
My xml file:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#f0f0f0"
android:orientation="vertical" >
<TextView
android:id="#+id/tvTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="17px" />
<TextView
android:id="#+id/tvSource"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="10px" />
<com.ibelieve.news.View.XListView
android:id="#+id/lvArray"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:cacheColorHint="#00000000" >
</com.ibelieve.news.View.XListView>
</LinearLayout>
Code file:
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.news_list);
listview = (XListView) findViewById(R.id.lvArray);
ArrayList<News> newslist = getIntent().getParcelableArrayListExtra("newslist");
ArrayList<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
String[] result = new String[newslist.size()];
for (int i = 0; i < newslist.size(); i++) {
for (int j = 0; j < 4; j++) {
Map<String, Object> map = new HashMap<String, Object>();
map.put("title", newslist.get(i).Title);
map.put("source", newslist.get(i).Source + " " + newslist.get(i).Time);
list.add(map);
}
}
simpleAdapter = new SimpleAdapter(NewsListActivity.this, list, R.layout.news_list, new String[] { "title", "source" }, new int[] { R.id.tvTitle, R.id.tvSource });
listview.setAdapter(simpleAdapter);
}
You are using your activity's resource as an item for list view. Move
<TextView
android:id="#+id/tvTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="17px" />
<TextView
android:id="#+id/tvSource"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="10px" />
To a new resource files and use that resource file in new SimpleAdapter(...) parameters
edit: oh and those "empty lines" are those textviews that you added in your activity's resources. And each your listview item contains an empty listview...ception
I am very new to Android and Java. I created 3 tabs using SherlockFragment by following AndroidBegin's tutorial. What I am trying to do is to stream notices into the first tab when i click. The display of stream notices is by ListView. I have created a class called StreamNotices.java and it is working well. My question is, how do I fetch/call this class and load my content when I press on 'Tab 1'?
ETA: it would be great if you could specifically tell me where to put as I am very clueless with where I am supposed to place my codes.
Help would be great!!
MainActivity.java
public class MainActivity extends SherlockFragmentActivity {
// Declare Variables
private FragmentTabHost mTabHost;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Set the view from main_fragment.xml
setContentView(R.layout.main_fragment);
// Locate android.R.id.tabhost in main_fragment.xml
mTabHost = (FragmentTabHost) findViewById(android.R.id.tabhost);
// Create the tabs in main_fragment.xml
mTabHost.setup(this, getSupportFragmentManager(), R.id.tabcontent);
// Create Tab1 with a custom image in res folder
mTabHost.addTab(mTabHost.newTabSpec("tab1").setIndicator("", getResources().getDrawable(R.drawable.tab1)),
FragmentTab1.class, null);
// Create Tab2
mTabHost.addTab(mTabHost.newTabSpec("tab2").setIndicator("Tab2"),
FragmentTab2.class, null);
// Create Tab3
mTabHost.addTab(mTabHost.newTabSpec("tab3").setIndicator("Tab3"),
FragmentTab3.class, null);
}
}
FragmentTab1.java
public class FragmentTab1 extends SherlockFragment {
#Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragmenttab1, container, false);
return rootView;
}
}
StreamNotices.java (sample code from mybringback.com)
public class StreamNotices extends ListActivity {
// Progress Dialog
private ProgressDialog pDialog;
.....
// JSON IDS:
private static final String TAG_NOTICE = "notice";
private static final String TAG_ANNOUNCEMENTID = "announcementid";
private static final String TAG_DEPTNO = "deptno";
private static final String TAG_MODULEID = "moduleid";
private static final String TAG_SUBJECT = "subject";
private static final String TAG_MESSAGE = "message";
private static final String TAG_SUCCESS = "success";
// it's important to note that the message is both in the parent branch of
// our JSON tree that displays a "Post Available" or a "No Post Available"
// message,
// and there is also a message for each individual post, listed under the
// "posts"
// category, that displays what the user typed as their message.
// An array of all of our comments
private JSONArray mComments = null;
// manages all of our comments in a list.
private ArrayList<HashMap<String, String>> mCommentList;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// note that use read_comments.xml instead of our single_post.xml
setContentView(R.layout.announcements);
}
#Override
protected void onResume() {
// TODO Auto-generated method stub
super.onResume();
// loading the comments via AsyncTask
new LoadComments().execute();
}
/**
* Retrieves recent post data from the server.
*/
public void updateJSONdata() {
// Instantiate the arraylist to contain all the JSON data.
// we are going to use a bunch of key-value pairs, referring
// to the json element name, and the content, for example,
// message it the tag, and "I'm awesome" as the content..
mCommentList = new ArrayList<HashMap<String, String>>();
// Bro, it's time to power up the J parser
JSONParser jParser = new JSONParser();
// Feed the beast our comments url, and it spits us
// back a JSON object. Boo-yeah Jerome.
JSONObject json = jParser.getJSONFromUrl(READ_COMMENTS_URL);
// when parsing JSON stuff, we should probably
// try to catch any exceptions:
try {
// I know I said we would check if "Posts were Avail." (success==1)
// before we tried to read the individual posts, but I lied...
// mComments will tell us how many "posts" or comments are
// available
mComments = json.getJSONArray(TAG_NOTICE);
// looping through all posts according to the json object returned
for (int i = 0; i < mComments.length(); i++) {
JSONObject c = mComments.getJSONObject(i);
// gets the content of each tag
String id = c.getString(TAG_ANNOUNCEMENTID);
String name = c.getString(TAG_DEPTNO);
String module = c.getString(TAG_MODULEID);
String title = c.getString(TAG_SUBJECT);
String content = c.getString(TAG_MESSAGE);
// creating new HashMap
HashMap<String, String> map = new HashMap<String, String>();
map.put(TAG_ANNOUNCEMENTID, id);
map.put(TAG_DEPTNO, name);
map.put(TAG_MODULEID, module);
map.put(TAG_SUBJECT, title);
map.put(TAG_MESSAGE, content);
// adding HashList to ArrayList
mCommentList.add(map);
// annndddd, our JSON data is up to date same with our array
// list
}
} catch (JSONException e) {
e.printStackTrace();
}
}
/**
* Inserts the parsed data into the listview.
*/
private void updateList() {
// For a ListActivity we need to set the List Adapter, and in order to do
//that, we need to create a ListAdapter. This SimpleAdapter,
//will utilize our updated Hashmapped ArrayList,
//use our single_post xml template for each item in our list,
//and place the appropriate info from the list to the
//correct GUI id. Order is important here.
ListAdapter adapter = new SimpleAdapter(this, mCommentList,
R.layout.single_post, new String[] { TAG_ANNOUNCEMENTID,
TAG_DEPTNO, TAG_MODULEID, TAG_SUBJECT, TAG_MESSAGE},
new int[] { R.id.announcementid, R.id.deptno, R.id.moduleid,
R.id.subject, R.id.message });
// I shouldn't have to comment on this one:
setListAdapter(adapter);
// Optional: when the user clicks a list item we
//could do something. However, we will choose
//to do nothing...
ListView lv = getListView();
lv.setOnItemClickListener(new OnItemClickListener() {
#Override
public void onItemClick(AdapterView<?> parent, View view,
int position, long id) {
// This method is triggered if an item is click within our
// list. For our example we won't be using this, but
// it is useful to know in real life applications.
}
});
}
public class LoadComments extends AsyncTask<Void, Void, Boolean> {
#Override
protected void onPreExecute() {
super.onPreExecute();
pDialog = new ProgressDialog(StreamNotices.this);
pDialog.setMessage("Loading Comments...");
pDialog.setIndeterminate(false);
pDialog.setCancelable(true);
pDialog.show();
}
#Override
protected Boolean doInBackground(Void... arg0) {
updateJSONdata();
return null;
}
#Override
protected void onPostExecute(Boolean result) {
super.onPostExecute(result);
pDialog.dismiss();
updateList();
}
}
}
MY XML file:
announcements.xml
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:background="#fff" >
<TextView
android:id="#+id/app_name_text"
style="#style/BlackText"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:text="#string/read_notices_title"
android:textAppearance="?android:attr/textAppearanceLarge" />
<ListView
android:id="#android:id/list"
android:layout_width="300dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="#fff"
android:divider="#android:color/transparent"
android:dividerHeight="10dp"
android:scrollbars="vertical"
android:textColor="#000" >
</ListView></LinearLayout>
single_post.xml (notices will stream to here before streaming into announcements)
enter code here<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#drawable/roundback"
android:paddingLeft="10dp"
android:paddingBottom="10dp"
android:paddingTop="10dp"
android:orientation="vertical" >
<!-- Announcement id layout -->
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="#+id/announcementid"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:textColor="#333"
android:textStyle="bold"
android:visibility="gone"/>
</LinearLayout>
<!-- date layout -->
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#5d5d5d"
android:gravity="right"
android:textStyle="bold"
android:text="#string/posted_date" >
</TextView>
<TextView
android:id="#+id/posted_date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:textColor="#333"
android:textStyle="bold" />
</LinearLayout>
<!-- Dept ID -->
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#5d5d5d"
android:gravity="left"
android:textStyle="bold"
android:text="#string/deptid" />
<TextView
android:id="#+id/deptno"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="left"
android:textColor="#acacac"
android:textStyle="bold" >
</TextView>
</LinearLayout>
<!-- Module id -->
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#5d5d5d"
android:gravity="left"
android:textStyle="bold"
android:text="#string/mid" />
<TextView
android:id="#+id/moduleid"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="left"
android:textColor="#acacac"
android:textStyle="bold" >
</TextView>
</LinearLayout>
<!-- subject -->
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#5d5d5d"
android:gravity="left"
android:textStyle="bold"
android:text="#string/subj" />
<TextView
android:id="#+id/subject"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="left"
android:textColor="#acacac"
android:textStyle="bold" >
</TextView>
</LinearLayout>
<!-- message -->
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="#+id/message"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingBottom="2dip"
android:paddingLeft="8dp"
android:textColor="#888" >
</TextView>
</LinearLayout>
</LinearLayout>
in your tab onClick()
if you use android.support.v.4. library
FragmentTransaction fTrans = getSupportFragmentManager().beginTransaction();
fTrans.add(R.id.frame_layout_inActivity_class, new Fragment());
fTrans.commit();
or if you does not use it
FragmentTransaction fTrans = getFragmentManager().beginTransaction();
fTrans.add(R.id.frame_layout_inActivity_class, new Fragment());
fTrans.commit();
I've made an application with a ListView. I'm to trying to add a footer to my ListView (which scrolls along with the ListView), using addFooterView. In this footer I want to add a TextView with some text which is defined in my Activity as a String called notification.
I've tried several things but it wouldn't work.
My ListActivity, RoosterWijzigingen.java:
public class RoosterWijzigingen extends ListActivity {
#Override
public void onCreate(Bundle savedInstanceState) {
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
super.onCreate(savedInstanceState);
ArrayList<HashMap<String, String>> roosterwijziginglist = new ArrayList<HashMap<String, String>>();
String hour = "4";
String info = "Af 123";
String notification = "Het is 40min-rooster!";
// Creating new HashMap
HashMap<String, String> map = new HashMap<String, String>();
// Adding each child node to HashMap key => value
map.put("hour", hour);
map.put("info", info);
// Adding HashList to ArrayList
roosterwijziginglist.add(map);}
ListAdapter adapter = new SimpleAdapter(this, roosterwijziginglist , R.layout.roosterwijzigingen,
new String[] {"hour", "info"},
new int[] {R.id.hour, R.id.info});
setListAdapter(adapter);
setContentView(R.layout.listplaceholder);
}
}
I get the information for the strings hour, info and notification from a JSON file, but I omited this to shorten the code.
listplaceholder.xml:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<ListView
android:id="#+id/android:list"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:drawSelectorOnTop="true" />
<TextView
android:id="#id/android:empty"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="No data" />
roosterwijzigingen.xml:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal" >
<TextView
android:id="#+id/hour"
android:layout_width="wrap_content"
android:layout_height="fill_parent" />
<TextView
android:id="#+id/info"
android:layout_width="match_parent"
android:layout_height="fill_parent" />
</LinearLayout>
You have to put your String in a TextView before adding it to your list, and it will look something like that :
String footerText = "Footer text";
TextView textView = new TextView(this);
textView.setText(footerText);
getListView().addFooterView(textView);
Remember that 99% of the time when you want to display something on the screen, it has to be a View.
In a 2-column row layout, is there a way to tell which of the columns the user clicked or pressed on?
If the second column can be a button, it would be even better, but I am not sure how to make it into a button. Here is what I am doing:
private List<HashMap<String, String>> fillMaps;
private SimpleAdapter simple_adapter;
ListView list = null;
and later:
list = (ListView) findViewById(android.R.id.list);
ArrayList<HashMap<String, String>> mylist = new ArrayList<HashMap<String, String>>();
// My data
fillMaps = new ArrayList<HashMap<String, String>>();
simple_adapter = new SimpleAdapter(this, fillMaps, R.layout.comment_list,
new String[] {"train", "from"},
new int[] {R.id.TRAIN_CELL, R.id.FROM_CELL });
// This was the middle item R.id.FROM_CELL,
list.setAdapter(simple_adapter);
list.setTextFilterEnabled(true);
and I populate the list like this:
for ( int i = 0; i < obj.length(); i++ )
{
JSONObject o = obj.getJSONObject(i);
HashMap<String, String> map = new HashMap<String, String>();
... Some variables set here...
map.put("train", comment);
map.put("from", "Edit");
fillMaps.add(map);
discussion.add( d );
}
}
simple_adapter.notifyDataSetChanged();
Here is the comment_list.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:paddingTop="4dip"
android:paddingBottom="6dip"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="13sp"
android:weightSum="1.0"
android:orientation="horizontal">
<TextView android:id="#+id/TRAIN_CELL"
android:textSize="16sp"
android:layout_height="wrap_content"
android:layout_width="275dip"/>
<TextView android:id="#+id/FROM_CELL"
android:textSize="16sp"
android:textStyle="bold"
android:layout_height="wrap_content"
android:layout_width="50dip"/>
</LinearLayout>
Thanks!
try using some clickable items in the two columns of the row and handle those click events.
Suppose give two buttons in those two columns and add setOnClickListeners to them and finally check which button is click in the activity
You can use something like this
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:paddingTop="4dip"
android:paddingBottom="6dip"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="13sp"
android:weightSum="1.0"
android:orientation="horizontal">
<Button
android:id="#+id/TRAIN_CELL"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp"
android:layout_height="wrap_content" />
<Button
android:id="#+id/FROM_CELL"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/label_grid_view" />
</LinearLayout>
Be back if you have any issues
I have JSON data which contents Strings and Image URLs, and I already parse it in the first Activity. How can I display it like the address book in my customized Listview in second Activity Should I customize an Adapter?
If that's the solution, what should I do?
I'm not familiar with Adapter.
Here's the code from the first Activity:
public class BBtest05Activity extends Activity {
/** Called when the activity is first created. */
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
try {
executeHttpGet();
} catch (Exception e) {
Log.i("bird","parser failure");
e.printStackTrace();
}
}
String aStr = new String();
String aStrArray[] = new String[2048];
public void executeHttpGet() throws Exception {
try {
HttpClient client = new DefaultHttpClient();
HttpGet request = new HttpGet("http://test.mobibon.com.tw/MovieGoTest/GetMovies.js");
HttpResponse response = client.execute(request);
String retSrc = EntityUtils.toString(response.getEntity(),"utf-8");
//there's a space in the head...
retSrc = retSrc.substring(1);
JSONObject obj = new JSONObject(retSrc);
JSONArray movieArray = obj.getJSONArray("movies");
for(int i = 0;i < movieArray.length(); i++)
{
JSONObject movie_data = movieArray.getJSONObject(i);
aStr = aStr+","+movie_data.getString("cTitle");
}
} finally {
aStrArray = aStr.split(",");
ListView list = (ListView) findViewById(R.id.linearLayout1);
list.setAdapter(new ArrayAdapter<String>(this,
android.R.layout.simple_list_item_1, aStrArray));
list.setTextFilterEnabled(true);
}
}
public void aMethod(View theButton) {
Intent i = new Intent(this,nowamovie.class);
startActivity(i);
}
}
the aMethod is changing Activity method...
and the following code is my XML file in second Activity...
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="match_parent"
android:layout_width="fill_parent"
android:orientation="vertical" android:background="#drawable/pic_background">
<LinearLayout android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:id="#+id/linearLayout1" >
<ImageView android:layout_height="wrap_content"
android:id="#+id/imageView1"
android:layout_width="wrap_content"
android:src="#drawable/ic_launcher"></ImageView>
<TextView android:text="TextView"
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="6dip"
android:layout_marginTop="6dip"
android:textAppearance="?android:attr/textAppearanceLarge">
</TextView>
</LinearLayout>
<LinearLayout android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:id="#+id/linearLayout1"
android:orientation="horizontal">
<TextView android:id="#+id/textView2"
android:text="TextView"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall">
</TextView>
<TextView android:text="TextView" android:id="#+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:layout_marginLeft="6dip">
</TextView>
</LinearLayout>
What should I do to put my data from JSON parser into this Activity?
Yes you need to customize your adapter and loading of images should be lazy, search on google for Lazy Implementation of images in list, and you would get enough material on this. In 3.0 there is a new feature introduced which is Loader, which do this lazy loading work for you.