خرید بک لینک

Vote count: 0

I need access to Radio Button outside onCreateView()

public void loadArray(String arrayName, Context mContext) {
    SharedPreferences prefs = mContext.getSharedPreferences("preferencename", 0);
    int size = prefs.getInt(arrayName + "_size", 0);
    int array[] = new int[size];

    for(int i=0;i<size;i++) {
        array[i] = prefs.getInt(arrayName + "_" + i, 0);
    }

    for(int i=0; i<size; i++) {
        RadioButton radio1 = (RadioButton) findViewById(array[i]);
    }
}

Of course findViewById() is not resolved here, inside onCreateView(), I can easily do rootView.findViewById()

asked 10 secs ago

برچسب: نویسنده: استخدام کار تاريخ: پنجشنبه 17 تير 1395 ساعت: 22:09

صفحه بندی