Android refresh LinearLayout after click - android

How can I refresh the LinearLayout called "contNoticias" after doing a click in a button?
Here is my code:
contNoticias = (LinearLayout)findViewById(R.id.contNoticias);
int arrayNoticias = 1;
for (int i = 0; i < arrayNoticias; i++) {
//agregar views
RelativeLayout relativeLayout = new RelativeLayout(antro.this);
relativeLayout.setPadding(0, 0, 0, 0);
relativeLayout.setId(+1);
contNoticias.addView(relativeLayout);
relativeLayout.setBackgroundResource(R.drawable.textviews_menu);
//Separar variables
try {
httpHandler handler = new httpHandler();
String response = handler.post(url + "MyDayFiles/muro.php");
JSONArray array = new JSONArray(response);
for (int u = 0; u < array.length(); u++) {
JSONObject jsonObject = array.getJSONObject(u);
tituloN += jsonObject.getString("nombre") + "/";
tituloN = tituloN.replace("null", "");
titulosN = tituloN.split("/");
noticiaN += jsonObject.getString("noticia") + "/";
noticiaN = noticiaN.replace("null", "");
noticiasN = noticiaN.split("/");
imagenN += jsonObject.getString("foto") + "/";
imagenN = imagenN.replace("null", "");
imagenesN = imagenN.split("/");
}
} catch (JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
//imagen
ImageView imagenNoticia = new ImageView(antro.this);
imagenNoticia.setId(+2);
RelativeLayout.LayoutParams imagenNoticiaParams = new RelativeLayout.LayoutParams(250, 250);
imagenNoticiaParams.addRule(RelativeLayout.ALIGN_PARENT_TOP);
imagenNoticiaParams.addRule(RelativeLayout.ALIGN_PARENT_LEFT);
imagenNoticiaParams.addRule(RelativeLayout.ALIGN_PARENT_START);
imagenNoticia.setLayoutParams(imagenNoticiaParams);
imagenNoticia.setScaleType(ImageView.ScaleType.CENTER_CROP);
Picasso.with(this).load(url + "MyDayFiles/imgnoticias/" + imagenesN[i]).into(imagenNoticia);
//imagen
//titulo
TextView tituloNoticia = new TextView(antro.this);
tituloNoticia.setId(+3);
RelativeLayout.LayoutParams tituloNoticiaParams = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
tituloNoticiaParams.addRule(RelativeLayout.RIGHT_OF, imagenNoticia.getId());
tituloNoticia.setLayoutParams(tituloNoticiaParams);
tituloNoticia.setTextColor(Color.DKGRAY);
tituloNoticia.setTextSize(12);
tituloNoticia.setPadding(20, 0, 0, 0);
tituloNoticia.setText(titulosN[i]);
//titulo
//noticia
TextView textoNoticia = new TextView(antro.this);
textoNoticia.setId(+4);
RelativeLayout.LayoutParams textoNoticiaParams = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
textoNoticiaParams.addRule(RelativeLayout.BELOW, tituloNoticia.getId());
textoNoticiaParams.addRule(RelativeLayout.RIGHT_OF, imagenNoticia.getId());
textoNoticia.setLayoutParams(textoNoticiaParams);
textoNoticia.setTextColor(Color.GRAY);
textoNoticia.setTextSize(12);
textoNoticia.setPadding(20, 0, 0, 0);
textoNoticia.setText(noticiasN[i]);
//noticia
//agregar views
relativeLayout.addView(imagenNoticia);
relativeLayout.addView(tituloNoticia);
relativeLayout.addView(textoNoticia);
}
The thing is I want to refresh the views inside my LinearLayout when the user clicks a button "Post" so the new post can be displayed at the screen at the moment the user clicks the button

Related

Two radiobutton got selected in a groupbutton in Android Studio

I created an app using Android Studio and one of its activity contain questions and their choices using radiobuttons. I created those groupbuttons and radiobuttons programmatically, but the first question can choose two radio button when it shouldn't.
This is my code:
FeedbackFragment.java
try {
loading.setVisibility(View.GONE);
JSONObject jsonObject = new JSONObject(response);
if (!jsonObject.isNull("questions")) {
JSONArray questions = jsonObject.getJSONArray("questions");
LinearLayout.LayoutParams params;
for (int i = 0; i < questions.length(); i++) {
final JSONObject oneQuestion = questions.getJSONObject(i);
if (!oneQuestion.isNull("answers")) {
TextView textQuestion = new TextView(getActivity());
params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,
LinearLayout.LayoutParams.WRAP_CONTENT);
textQuestion.setLayoutParams(params);
textQuestion.setText(oneQuestion.getString("question_text"));
if(textQuestion.getParent() != null) {
((ViewGroup) textQuestion.getParent()).removeView(textQuestion);
}
layoutFeedback.addView(textQuestion);
groupChoice = new RadioGroup(getActivity());
params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,
LinearLayout.LayoutParams.WRAP_CONTENT);
params.setMargins(0,0,0,20);
groupChoice.setLayoutParams(params);
groupChoice.setId(Integer.valueOf(oneQuestion.getString("question_id")));
groupChoices.add(groupChoice);
if(groupChoice.getParent() != null) {
((ViewGroup) groupChoice.getParent()).removeView(groupChoice);
}
layoutFeedback.addView(groupChoice);
JSONArray choices = oneQuestion.getJSONArray("answers");
for(int j=0;j<choices.length();j++) {
JSONObject choice = choices.getJSONObject(j);
radioChoice = new RadioButton(getActivity());
radioChoice.setId(Integer.valueOf(choice.getString("answer_id")));
radioChoice.setText(choice.getString("answer_text"));
radioChoice.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));
radioChoice.setButtonTintList(new ColorStateList(
new int[][]{
new int[]{-android.R.attr.state_enabled}, //disabled
new int[]{android.R.attr.state_enabled} //enabled
},
new int[] {
Color.BLACK //disabled
,getResources().getColor(R.color.colorPrimary) //enabled
}
));
groupChoice.addView(radioChoice);
}
LinearLayout borderBottom = new LinearLayout(getActivity());
params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,
1);
params.setMargins(0, 0, 0, 20);
borderBottom.setLayoutParams(params);
borderBottom.setBackgroundColor(Color.parseColor("#999999"));
borderBottom.setVerticalGravity(Gravity.BOTTOM);
layoutFeedback.addView(borderBottom);
}
}
}
} catch (JSONException e) {
e.printStackTrace();
Toast.makeText(getActivity(), "Error JSON Exception! " + e.toString(), Toast.LENGTH_SHORT).show();
loading.setVisibility(View.GONE);
}
The weird thing is, it only happened at first question, the other question worked fine. What went wrong? Please help.

How do I sort the buttons generated from the following code alphabetically base on string values

<string name="Manuf0">best</string>
<string name="Manuf1">Bravo</string>
<string name="Manuf2">zoo</string>
<string name="Manuf3">Skitz</string>
<string name="Manuf4">don</string>
<string name="Manuf5">animal</string>
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
scrollviewManuf = new ScrollView(this);
LinearLayout linearlayout = new LinearLayout(this);
linearlayout.setOrientation(LinearLayout.VERTICAL);
scrollviewManuf.addView(linearlayout);
for (int i = 0; i < 5; i++)
{
LinearLayout linearManuf = new LinearLayout(this);
linearManuf.setOrientation(LinearLayout.HORIZONTAL);
linearlayout.addView(linearManuf);
Manufb = new Button(this);
int id = getResources().getIdentifier("Manuf" + i, "string", getPackageName());
String Manuf = getResources().getString(id);
Manufb.setText(Manuf);
Manufb.setId(i);
Manufb.setTextSize(30);
Manufb.setPadding(0, 0, 0, 0);
// b.setTypeface(Typeface.SERIF,Typeface.ITALIC);
Manufb.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
linearManuf.addView(Manufb);
Manufb.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
// TODO Auto-generated method stub
String SManuf= Manuf.replaceAll("&","").replaceAll(" ","").replaceAll("/","").replaceAll(" / ","").replaceAll("/ ","").replaceAll(" /","".replaceAll("&",""));
//Panel= getResources().getString(id);
Toast.makeText(getApplicationContext(), SManuf , Toast.LENGTH_SHORT).show();
Intent passIntent = new Intent(Manufacturers.this,panels.class);
passIntent.putExtra("SManuf",SManuf);
startActivity(passIntent);
}
});
}
this.setContentView(scrollviewManuf);
}
}
How do I sort the buttons generated from the following code alphabetically base on string values.
Currently they are listed as the buttons are produced 0 through to 5.
The list is in an xml string file, want to eb alphabetical so I can just add more to the file as needs be, and the programming just sort it alphabetically which suits me.
Not been able to find anything yet , but I am gueesing I may need to define the list in the file and sort that list can anyone point me in the right direction please.
Okay, so I can see the code is doing something but the sort order isn't changing and the String s is showing up in intellij as not used, : new code below:-
marked the sections with // here
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ArrayList<String> theStrings = new ArrayList<>();//Here
scrollviewManuf = new ScrollView(this);
LinearLayout linearlayout = new LinearLayout(this);
linearlayout.setOrientation(LinearLayout.VERTICAL);
scrollviewManuf.addView(linearlayout);
for (int i = 0; i < 28; i++) {
LinearLayout linearManuf = new LinearLayout(this);
linearManuf.setOrientation(LinearLayout.HORIZONTAL);
linearlayout.addView(linearManuf);
Manufb = new Button(this);
int id = getResources().getIdentifier("Manuf" + i, "string", getPackageName());
String Manuf = getResources().getString(id);
theStrings.add(Manuf); /// Here
Manufb.setText(Manuf);
Manufb.setId(i);
Manufb.setTextSize(30);
Manufb.setPadding(0, 0, 0, 0);
// b.setTypeface(Typeface.SERIF,Typeface.ITALIC);
Manufb.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
linearManuf.addView(Manufb);
Manufb.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
String PManuf =Manuf;
// TODO Auto-generated method stub
String SManuf= Manuf.replaceAll("&","").replaceAll(" ","").replaceAll("/","").replaceAll(" / ","").replaceAll("/ ","").replaceAll(" /","".replaceAll("&",""));
//Panel= getResources().getString(id);
Toast.makeText(getApplicationContext(), Manuf+" Selected" , Toast.LENGTH_SHORT).show();
Intent passIntent = new Intent(Manufacturers.this,panels.class);
passIntent.putExtra("SManuf",SManuf);
passIntent.putExtra("PManuf",PManuf);
startActivity(passIntent);
}
} );
} Collections.sort(theStrings); //here
for (String s : theStrings) { //here
//...
this.setContentView(scrollviewManuf); }//here
}
}
The following code is looping each time it loops its adding an extra repeated option.
ie. Cat,dog,mouse, donkey correct list is the list but I am getting, Cat, dog.dog, mouse,mouse,mouse, donkey, donkey, donkey,donkey but still no sorting, still working on it but here is the code.
ArrayList<String> theStrings = new ArrayList<>();
for (int i = 0; i < 28; i++) {
int id = getResources().getIdentifier("Manuf" + i, "string", getPackageName());
String Manuf = getResources().getString(id);
theStrings.add(Manuf);
Collections.sort(theStrings);
for (String s : theStrings) {
LinearLayout linearManuf = new LinearLayout(this);
linearManuf.setOrientation(LinearLayout.HORIZONTAL);
linearlayout.addView(linearManuf);
Manufb = new Button(this);
Manufb.setText(Manuf);
Manufb.setId(i);
Manufb.setTextSize(30);
Manufb.setPadding(0, 0, 0, 0);
// b.setTypeface(Typeface.SERIF,Typeface.ITALIC);
Manufb.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
linearManuf.addView(Manufb);
Manufb.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
String PManuf = Manuf;
// TODO Auto-generated method stub
String SManuf = Manuf.replaceAll("&", "").replaceAll(" ", "").replaceAll("/", "").replaceAll(" / ", "").replaceAll("/ ", "").replaceAll(" /", "".replaceAll("&", ""));
//Panel= getResources().getString(id);
Toast.makeText(getApplicationContext(), Manuf + " Selected", Toast.LENGTH_SHORT).show();
Intent passIntent = new Intent(Manufacturers.this, panels.class);
passIntent.putExtra("SManuf", SManuf);
passIntent.putExtra("PManuf", PManuf);
startActivity(passIntent);
}
});
}
}
this.setContentView(scrollviewManuf);
}
}
Read it into a list, sort it and loop over it:
ArrayList<String> theStrings = new ArrayList<>();
for (int i = 0; i < 28; i++) {
int id = getResources().getIdentifier("Manuf" + i, "string", getPackageName());
String Manuf = getResources().getString(id);
theStrings.add(Manuf);
}
Collections.sort(theStrings);
for (String s : theStrings) {
LinearLayout linearManuf = new LinearLayout(this);
linearManuf.setOrientation(LinearLayout.HORIZONTAL);
linearlayout.addView(linearManuf);
Manufb = new Button(this);
Manufb.setText(s); // <-- use the String here
Manufb.setId(i);
Manufb.setTextSize(30);
Manufb.setPadding(0, 0, 0, 0);
// b.setTypeface(Typeface.SERIF,Typeface.ITALIC);
Manufb.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
linearManuf.addView(Manufb);
...

How to fetch text in Textview field through JSON in android?

I am developing android application in which i have 12 Dynamic Frame layout in which Frame layout having Text view,video,and play/pause button over it .I want to fetch text in the Text view field by JSON. But my problem is that when i fetch text in Text view field using JSON text will appear in 12th frame and rest of 11 frame are empty.I don't know how to resolve this .kindly help me .
public class MainActivity extends Activity {
String moviename;
private ProgressDialog pDialog;
VideoView vv;
TextView showingat, movie;
FrameLayout frame;
ArrayList<String> abc;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.navigationbar);
abc = new ArrayList<>();
new Theaterflow().execute();
//Main Relative layout.
final RelativeLayout rl = (RelativeLayout)findViewById(R.id.MainRelativeLayout);
//Main Scrollview.
final ScrollView sv = (ScrollView) findViewById(R.id.scrollView);
//Main Linearlayout.
final LinearLayout ll = (LinearLayout) findViewById(R.id.LinearLayout1);
//Dynamically creation of Layouts.
FrameLayout.LayoutParams playpausebtn = new FrameLayout.LayoutParams(70, 70);
FrameLayout.LayoutParams sound = new FrameLayout.LayoutParams(55, 35);
FrameLayout.LayoutParams nowshwingat = new FrameLayout.LayoutParams(200, 60);
FrameLayout.LayoutParams movie_name = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, 60);
//Defining array for framelayout.
ArrayList fHolder = new ArrayList();
int l = 12;
for (int i = 0; i<=l; i++) {
//Dynamically frameslayout for video
fHolder.add(frame);
frame = new FrameLayout(this);
FrameLayout.LayoutParams frameparams = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, 350);
frameparams.setMargins(0, 2, 0, 0);
frame.setId(i + 1);
frame.setMinimumHeight(350);
ll.addView(frame);
// Video over frames
vv = new VideoView(this);
vv.setId(i + 1);
vv.setLayoutParams(frameparams);
vv.setMinimumHeight(350);
frame.addView(vv);
//Pause btn over video
Button pausebtn = new Button(this);
pausebtn.setId(i + 1);
pausebtn.setBackgroundResource(R.drawable.pause);
pausebtn.setLayoutParams(playpausebtn);
playpausebtn.gravity = Gravity.CENTER;
frame.addView(pausebtn);
//Play btn over video
Button playbtn = new Button(this);
playbtn.setLayoutParams(playpausebtn);
playbtn.setId(i + 1);
playbtn.setBackgroundResource(R.drawable.playy);
playpausebtn.gravity = Gravity.CENTER;
frame.addView(playbtn);
//Sound btn over video
Button soundbtn = new Button(this);
soundbtn.setLayoutParams(sound);
soundbtn.setId(i + 1);
soundbtn.setBackgroundResource(R.drawable.sound);
sound.setMargins(0, 15, 5, 0);
sound.gravity = Gravity.RIGHT;
frame.addView(soundbtn);
//now showing at over video
showingat = new TextView(this);
showingat.setLayoutParams(nowshwingat);
showingat.setText("Now showing at ");
showingat.setTextSize(15);
showingat.setTextColor(getResources().getColor(R.color.white));
nowshwingat.setMargins(10, 0, 0, 0);
nowshwingat.gravity = Gravity.LEFT | Gravity.BOTTOM;
frame.addView(showingat);
movie = new TextView(MainActivity.this);
movie.setLayoutParams(movie_name);
movie.setId(i+1);
movie.setText(" ");
movie.setTextSize(15);
movie.setTextColor(getResources().getColor(R.color.white));
movie_name.setMargins(10, 10, 0, 0);
movie_name.gravity = Gravity.TOP | Gravity.LEFT;
frame.addView(movie);
}
}
private class Theaterflow extends AsyncTask<String, Void, String> {
// URL to get contents JSON
String url = "http://filfest.in/demo/theater/first-theater-data.php";
JSONArray contents = null;
protected void onPreExecute() {
super.onPreExecute();
pDialog = new ProgressDialog(MainActivity.this);
pDialog.setMessage("Loading Data ...");
pDialog.setIndeterminate(false);
pDialog.setCancelable(false);
pDialog.show();
}
#Override
protected String doInBackground(String...urls){
ArrayList arraylist = new ArrayList<HashMap<String, String>>();
ServiceHandler sh = new ServiceHandler();
// Making a request to url and getting response
String jsonstr = sh.makeServiceCall(url, null);
if (jsonstr != null) {
try {
JSONObject jObject1 = new JSONObject(jsonstr);
contents = jObject1.optJSONArray("contents");
for (int i = 0; i < contents.length(); i++) {
JSONObject c1 = contents.getJSONObject(i);
moviename = c1.getString("movie_name");
abc.add(moviename);
}
} catch (JSONException e) {
e.printStackTrace();
}
}
return null;
}
public void onPostExecute(String result) {
if (pDialog.isShowing())
pDialog.dismiss();
for (int i=0;i<abc.size();i++)
{
movie.setText(moviename);
}
}
}
}
Add view Programatically in LinearLayout:
layout.xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/llParent"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
</LinearLayout>
Activity.java:
LinearLayout llParent = (LinearLayout)findViewById(R.id.llParent);
onPostExecute() of AsyncTask:
for (int i=0;i<Your_ArrayList.size(); i++){
TextView txtView = new TextView(this);
txtView.setText(Your_ArrayList.get(i).getMovieName());
llParent.addView(txtView);
}
Edit:
llParent.invalidate();
Hope this will help you.
inside your for loop
movie = new TextView(MainActivity.this);
movie.setTag(i);
insid your onPost() for loop
final int childCount = ll.getChildCount();
for (int y = 0; y < childCount; y++) {
final View child = ll.getChildAt(y);
if (child instanceof FrameLayout) {
int childs = ((FrameLayout) child).getChildCount();
for (int j = 0; j < childs; j++) {
final View childViews = ((ViewGroup) child)
.getChildAt(j);
if (childViews instanceof TextView) {
final Object tagObj = childViews.getTag();
if (tagObj != null && tagObj.equals(i)) {
((TextView) childViews).setText("Movie "
+ i);
}
}
}
}
}

android_dynamically adding rows, how to get which row is clicked?

So I am dynamically adding rows to table which consist of some data (httpresponse) and buttons (like delete). How can I add onClickListener for delete button so it knows which row I want to delete?
This is part of my code, if you need more let me know:
try {
HttpResponse httpResponse = httpclient.execute(request);
String result = EntityUtils.toString(httpResponse.getEntity());
if (!result.isEmpty()) {
JSONArray ja = new JSONArray(result);
for (int i = 0; i < ja.length(); i++) {
JSONObject jsonObjekt = ja.getJSONObject(i);
Racuni novi = new Racuni();
novi.setCode(jsonObjekt.getString("Code"));
novi.setDate(jsonObjekt.getString("Date"));
novi.setTotal(jsonObjekt.getString("Total"));
niz.add(i, novi);
}
for (int i = 0; i < niz.size(); i++) {
TableRow redak = new TableRow(getApplicationContext());
final TextView code = new TextView(getApplicationContext());
code.setText(niz.get(i).getCode());
code.setPadding(0, 0, 5, 0);
TextView date = new TextView(getApplicationContext());
date.setText(niz.get(i).getDate());
date.setPadding(0, 0, 5, 0);
TextView total = new TextView(getApplicationContext());
total.setText(niz.get(i).getTotal());
total.setPadding(0, 0, 5, 0);
final Button print = new Button(getApplicationContext());
print.setText("P");
final Button delete = new Button(getApplicationContext());
delete.setText("D");
delete.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View view) {
//so this is what i would like it to do, but with the proper id
int id = Integer.parseInt(code.getText().toString());
HttpClient httpclient = new DefaultHttpClient();
HttpGet request = new HttpGet("http://staging-api.e-poslovanje.hr/ReceiptCash/Delete" + "?id=" + id);
request.addHeader("Authorization", "Basic " + base64EncodedCredentials);
try {
httpclient.execute(request);
Toast.makeText(getApplicationContext(), "You have deleted receipt " + code.getText().toString(), 5000).show();
} catch (ClientProtocolException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
});
redak.addView(code);
redak.addView(date);
redak.addView(total);
redak.addView(delete);
redak.addView(print);
list.addView(redak);
}
You can use Tag to hold the Id.
On the delete button , set the Id as tag
tag. delete.setTag(code.getText().toString())
and on onClick() you can retrieve the id like..
int = delete.getTag();
Create a "Row" class with Buttons and Textview. Instead of creating each button in the for loop just create a row
class Row{
Button delete
Button print
Textview date
public Row(){
delete.setOnClickListener(.....);
}
}
and than in mainActivity
for (int i = 0; i < niz.size(); i++) {
Row row=new Row();
}

Display the array in android

How to get an array items like this
["String1", "string2", "string3",.....,"Stringn"]
but if we use Arrays.toString(array) it will display like [string1, string2, string3] but i want like above.
Thnaks in advance
This is how I did it:
private void btn3() {
LinearLayout layout = (LinearLayout) findViewById(R.id.ll);
layout.removeAllViewsInLayout();
layout.setPadding(15, 15, 15, 15);
tv2 = new TextView[list.size()];
for (int i = 0; i < list.size(); i++) {
tv2[i] = (TextView) new TextView(Random.this);
}
LayoutParams lparams = new LayoutParams(LayoutParams.WRAP_CONTENT,
LayoutParams.WRAP_CONTENT);
for (int i = 0; i < list.size(); i++) {
tv2[i].setLayoutParams(lparams);
tv2[i].setText((i + 1) + " " + list.get(i));
layout.addView(tv2[i]);
}
}

Categories

Resources