public class Language_Profile extends AppCompatActivity {
private Languages_Courses_Fragment lcf;
private List<slide> firstSlides;
private ViewPager courceSlidePager,viewPager_language;
private TabLayout tablayout_language;
private Button button;
private TextView lname;
private ImageView limage;
private Button intbutton, discbutton, cbutton;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_language_profile);
button=findViewById(R.id.button);
lname= findViewById(R.id.nameoflanguage);
limage= findViewById(R.id.imageoflanguage);
tablayout_language=findViewById(R.id.tablayout_language);
viewPager_language=findViewById(R.id.viewPager_language);
courceSlidePager=findViewById(R.id.courceSlidePager);
FragmentAdapter adapter=new FragmentAdapter(getSupportFragmentManager());
adapter.AddFragment(new Languages_Courses_Fragment(),"Introduction");
adapter.AddFragment(new Languages_Books_Fragment(),"Courses/Books");
adapter.AddFragment(new Languages_Discuss_Fragment(),"Discuss");
viewPager_language.setAdapter(adapter);
tablayout_language.setupWithViewPager(viewPager_language);
String langimage = getIntent().getStringExtra("coursephoto");
String langname = getIntent().getStringExtra("coursename");
String ldescription = getIntent().getStringExtra("coursedescription");
lname.setText(langname);
Picasso.get().load(langimage).into(limage);
Languages_Courses_Fragment cfragment= new Languages_Courses_Fragment ();
Bundle bundle = new Bundle();
bundle.putString("description", ldescription);
cfragment.setArguments(bundle);
getSupportFragmentManager().beginTransaction()
.replace(R.id.fragment_container, cfragment, cfragment.getTag())
.addToBackStack(null)
.commit();
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.slidersample, PID: 22952
java.lang.IllegalArgumentException: No view found for id 0x7f0a007f
(com.example.slidersample:id/fragment_container) for fragment Languages_Courses_Fragment{d35baaf #0
id=0x7f0a007f}
at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManager.java:1454)
at
androidx.fragment.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1784)
at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManager.java:1852)
at androidx.fragment.app.BackStackRecord.executeOps(BackStackRecord.java:802)
at androidx.fragment.app.FragmentManagerImpl.executeOps(FragmentManager.java:2625)
at androidx.fragment.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2411)
at androidx.fragment.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManager.java:2366)
at androidx.fragment.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2273)
at androidx.fragment.app.FragmentManagerImpl.dispatchStateChange(FragmentManager.java:3273)
at androidx.fragment.app.FragmentManagerImpl.dispatchActivityCreated(FragmentManager.java:3229)
at androidx.fragment.app.FragmentController.dispatchActivityCreated(FragmentController.java:201)
at androidx.fragment.app.FragmentActivity.onStart(FragmentActivity.java:620)
at androidx.appcompat.app.AppCompatActivity.onStart(AppCompatActivity.java:178)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1425)
at android.app.Activity.performStart(Activity.java:7825)
at android.app.ActivityThread.handleStartActivity(ActivityThread.java:3294)
at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:221)
at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:201)
at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:173)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7356)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
Привет! Я пытаюсь отправить данные из действия во фрагмент, но Android Studio выдает ошибку, которая называется "Нет просмотра для фрагмента". Как я могу решить это? Привет! Я пытаюсь отправить данные из действия во фрагмент, но Android Studio выдает ошибку, которая называется "Нет просмотра для фрагмента". Как я могу решить это?
public class Languages_Courses_Fragment extends Fragment {
PieChart salary_language;
TextView ldesript;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View view = inflater.inflate(R.layout.fragment_languages_courses, container, false);
salary_language =view.findViewById(R.id.salary_language);
/*ldesript = view.findViewById(R.id.ldesc);
Bundle bundle = getArguments();
String myValue = bundle.getString("desc");
ldesript.setText(myValue);*/
String str = getArguments().getString("description");
ldesript.setText(str);
pieChartValues();
return view;
}