lang
1import android.widget.TextView; 2 3public class vewChange { 4 5 public vewChange(MainActivity mainActivity) { 6 // TODO Auto-generated constructor stub 7 TextView tv = (TextView) mainActivity.findViewById(R.id.textView1); 8 tv.setText("change"); 9 } 10}
このソースで
lang
1 2 if(view == button7){ 3 TypedArray typedArray = getResources().obtainTypedArray(R.array.aaa); 4 int i = (int) (Math.floor(Math.random() * (50)) ); 5 String str = typedArray.getString(i); 6 textView1.setText(str);} 7
を使いたい場合どのようにすればいいのでしょうか。