OutputStream outputStream = null;
try {
outputStream = openFileOutput(fileName, 0);
} catch (FileNotFoundException e) {
e.printStackTrace();
}
OutputStreamWriter osw = new OutputStreamWriter(outputStream);
PackageManager pm = this.getPackageManager();
try {
PermissionInfo info = pm.getPermissionInfo(Manifest.permission.ACCESS_FINE_LOCATION, 0);
Log.d("TEST.PERM", info.loadLabel(pm).toString());
} catch (PackageManager.NameNotFoundException e) {
e.printStackTrace();
Log.d("TEST.PERM", "ERROR");
}
tabLayout = (TabLayout) vFragment.findViewById(R.id.tabLayout);
tabLayout.setOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
@Override
public void onTabSelected(TabLayout.Tab tab) {
mViewPager.setCurrentItem(tab.getPosition(), true);
}
@Override
public void onTabUnselected(TabLayout.Tab tab) {
}
@Override
public void onTabReselected(TabLayout.Tab tab) {
mViewPager.setCurrentItem(tab.getPosition(), true);
}
});
Относительно цикла и дополнительного условия в OnItemClick для ListView
Возможно ли оформить алгоритм между RadioGroup и ListView в программе
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int position2, long id) {
znachn1 = (id < 9) ? 9 - id : 0;
}
rgroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(RadioGroup radioGroup, @IdRes int q) {
d = 1;
b = 1;
if (q == sravnenkr1.getId()) {
d = znachn1;
b = 1 / d;
}
else if (q == sravnenkr2.getId()) {
b = znachn1;
d = 1 / b;
}
}
);