Create a Stub Activity
The first thing we need to do is create an activity to serve as our detail form.
In a flash of inspiration, let's call it DetailForm. So, create a LunchList/src/apt/tutorial/DetailForm.java file with the following content:
package apt.tutorial;
import android.app.Activity;
import android.os.Bundle;
public class DetailForm extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// setContentView(R.layout.main);
}
}
This is just a stub activity, except it has the setContentView() line commented out. That is because we do not want to use main.xml, as that is the layout for LunchList. Since we do not have another layout ready yet, we
can just comment out the line. As we will see, this is perfectly legal, but it means the activity will have no UI.
In a flash of inspiration, let's call it DetailForm. So, create a LunchList/src/apt/tutorial/DetailForm.java file with the following content:
package apt.tutorial;
import android.app.Activity;
import android.os.Bundle;
public class DetailForm extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// setContentView(R.layout.main);
}
}
This is just a stub activity, except it has the setContentView() line commented out. That is because we do not want to use main.xml, as that is the layout for LunchList. Since we do not have another layout ready yet, we
can just comment out the line. As we will see, this is perfectly legal, but it means the activity will have no UI.
No comments:
Post a Comment