|
 |
|
ขอสอบถามเรื่องการใช้งาน List<TextView> บน Android Studio ครับ |
|
 |
|
|
 |
 |
|
ขอบคุณมากครับ
|
 |
 |
 |
 |
Date :
2017-09-05 10:35:51 |
By :
natchaphon_ |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code (Android-Java)
List<TextView> listtxt = new ArrayList<TextView>();
for (int i = 1; i <= 10; i++) {
{
String buttonID = "txt" + i;
int resID = getResources().getIdentifier(buttonID, "id",getPackageName());
listtxt .add((TextView)findViewById(resID));
}
}
// test
listtxt .get(0).setText("Hello World");
ทำได้แล้วมาแชร์ต่อครับ ผิดพลาดประการใดขออภัยด้วยครับ
|
 |
 |
 |
 |
Date :
2017-09-05 11:36:02 |
By :
natchaphon_ |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
เยี่ยมไปเบย
|
 |
 |
 |
 |
Date :
2017-09-06 13:11:46 |
By :
mr.win |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 04
|