Hi I have main activity with layout like
<?xml version="1.0" encoding="utf-8"?><LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:orientation="vertical" android:background="#ffffff"> <LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:orientation="horizontal" android:weightSum="9"
android:background="@drawable/buttonsborder"> <Button
android:id="@+id/Chemo" android:layout_width="0dp"
android:layout_weight="1" android:layout_height="wrap_content"
android:text="Chemo" android:background="@drawable/firstbuttoncolorstyle"
android:textColor="@drawable/firstbuttontextstyle"
android:textSize="22dp" android:layout_gravity="center" />
<Button android:id="@+id/inpatient" android:layout_width="0dp"
android:layout_weight="1" android:layout_height="wrap_content"
android:text="Inpatient"
android:background="@drawable/firstbuttoncolorstyle"
android:textColor="@drawable/firstbuttontextstyle" android:textSize="22dp"
android:layout_gravity="center" android:layout_marginLeft =
"5dp"/> </LinearLayout> <!-- the two columns part --> <LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:layout_weight="0.80" android:orientation="horizontal"
> <LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:layout_weight="1.5" android:id="@+id/submenue"
android:background="@drawable/submenuestyle" >
</LinearLayout> <LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:layout_weight=".40" android:id="@+id/mainLayout">
</LinearLayout> </LinearLayout></LinearLayout>
I add fragment to mainLayout using this code
public class maincontrolActivity extends FragmentActivity { Button Chemo;
Button inpatient; Button Mgmt; Button PatientSearch; Button
AppointSearch ; Button LogOut; ListView menueview; String[] MainMenue ;
private static final int ALERT_DIALOG = 1; ArrayList<TreatementBasic>
TDayList ; final FragmentManager fragmentManager =
getSupportFragmentManager(); /** Called when the activity is first
created. */ @Override public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.maincontrol); this.inpatient.setOnClickListener(new
OnClickListener() { public void onClick(View v) {
LinearLayout formLayout = (LinearLayout)findViewById(R.id.mainLayout);
formLayout.removeAllViews();
FragmentTransaction fragmentTransaction =
fragmentManager.beginTransaction();
//PatientSearch fragment = new PatientSearch(maincontrolActivity.this);
fragmentTransaction.add(R.id.mainLayout,type, "MY_FRAG");
fragmentTransaction.commit();
} }); }
in this fragment I want to reload another using
startActivity(new Intent(PatientSearch.this.getActivity(),
AppointementSearch.class).putExtra("Position",0)); but it crash with log :
07-18 14:24:31.145: E/AndroidRuntime(27449): java.lang.RuntimeException: Unable
to instantiate activity
ComponentInfo{com.appnetics/com.appnetics.AppointementSearch}:
java.lang.InstantiationException: com.appnetics.AppointementSearch
07-18 14:24:31.145: E/AndroidRuntime(27449): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1739)
07-18 14:24:31.145: E/AndroidRuntime(27449): at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1831)
07-18 14:24:31.145: E/AndroidRuntime(27449): at
android.app.ActivityThread.access$500(ActivityThread.java:122)
07-18 14:24:31.145: E/AndroidRuntime(27449): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1024)
07-18 14:24:31.145: E/AndroidRuntime(27449): at
android.os.Handler.dispatchMessage(Handler.java:99)
07-18 14:24:31.145: E/AndroidRuntime(27449): at
android.os.Looper.loop(Looper.java:132)
07-18 14:24:31.145: E/AndroidRuntime(27449): at
android.app.ActivityThread.main(ActivityThread.java:4123)
07-18 14:24:31.145: E/AndroidRuntime(27449): at
java.lang.reflect.Method.invokeNative(Native Method)
07-18 14:24:31.145: E/AndroidRuntime(27449): at
java.lang.reflect.Method.invoke(Method.java:491)
07-18 14:24:31.145: E/AndroidRuntime(27449): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:849)
07-18 14:24:31.145: E/AndroidRuntime(27449): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:607)
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en