[Solved] findViewById returns null and also : where to define my onClick?

the Problem is here: RadioButton rb = (RadioButton) findViewById(R.id.radio32); You should show which view you are getting the RadioButton, it should be something like this: View v = inflater.inflate(R.layout.your_layout, container, false); RadioButton rb = (RadioButton) v.findViewById(R.id.radio32); 1 solved findViewById returns null and also : where to define my onClick?

[Solved] send string data from Activity to fragment [closed]

Add below code inside listview itemclick listner in activity: Tozihat gTozihat = new Tozihat().newInstance(“Data”); getSupportFragmentManager().beginTransaction() .replace(R.id.textViewTozihat, gTozihat).commit(); Inside your Fragment : private static final String TYPE = “DATA_KEY”; public static Tozihat newInstance(String type) { Tozihat fragment = new Tozihat(); Bundle args = new Bundle(); args.putString(TYPE, type); fragment.setArguments(args); return fragment; } 3 solved send string data … Read more

[Solved] error: cannot find symbol method setContentView(int) [duplicate]

In fragment you inflate the layout not setContentView the code maybe look like this @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragment1_layout, container, false); // Put your fragment code here return rootView; } 9 solved error: cannot find symbol method setContentView(int) [duplicate]

[Solved] JSON parsing in fragmant [closed]

It seems that your AndroidManifest.xml doesn’t give permission for your app to access the Internet. Your error log states: Permission denied (missing INTERNET permission?) Taken from The Android docs at http://developer.android.com/reference/android/Manifest.permission.html#INTERNET String | INTERNET | Allows applications to open network sockets. Add the following line to your AndroidManifest.xml to allow Internet access: <uses-permission android:name=”android.permission.INTERNET” /> … Read more

[Solved] Android fragment null pointer exception on rootView [closed]

Would you mind moving Intent checkTTSIntent = new Intent(); checkTTSIntent.setAction(TextToSpeech.Engine.ACTION_CHECK_TTS_DATA); startActivityForResult(checkTTSIntent, MY_DATA_CHECK_CODE); To the onViewCreated methode? And where is the part where you setOnInitListener to the fragment implementation? 7 solved Android fragment null pointer exception on rootView [closed]