Android : when i put 'addView(..) inside a forloop i got error..Here we go -


यहां कोड का नमूना:

  टेबल लेआउट ll = (टेबल लेआउट) findViewById (R.id .dyn_lyr);   

रैखिक लेआउट के साथ भी ऐसा ही है

  // लाइनरलेआउट लो = (रैखिक लयआउट) ढूंढिए वीवीबीआईआईडी (आर.डिडिन)।; TextView tv1 = (TextView) findViewById (R.id.testEditText); tv1.setText ( "SomeTextGoesHere"); के लिए (इंट आई = 1; आई & lt; = 5; i ++) {ll.addView (tv1); }   

LinearLayout / Table ScrollView में है!

आप TextView को डायनेमिक रूप से बनाएं और इसमें जोड़ें ...

  के लिए (int i = 1; i & lt; = 5; i ++) {टेक्स्टव्यू टीवी 1 = नया टेक्स्टव्यू (getApplicationContext ()); tv1.setText ( "SomeTextGoesHere"); ll.addView (TV1); }    

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -