Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 5th, 2012  |  syntax: None  |  size: 0.81 KB  |  hits: 12  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. When a layout is not explicity declared, what is the default layout for an Activity?
  2. public class HelloWorld extends Activity {
  3.  
  4.     @Override
  5.     public void onCreate(Bundle savedInstanceState) {
  6.         super.onCreate(savedInstanceState);
  7.         setContentView(R.layout.helloworld);
  8.     }
  9.  
  10. }
  11.        
  12. <?xml version="1.0" encoding="utf-8"?>
  13. <TextView xmlns:android="http://schemas.android.com/apk/res/android"
  14. android:id="@+id/textview"
  15. android:layout_width="fill_parent"
  16. android:layout_height="fill_parent"
  17. android:text="@string/hello"/>
  18.        
  19. void     setContentView(int layoutResID)
  20. Set the activity content from a layout resource.
  21.  
  22. void     setContentView(View view)
  23. Set the activity content to an explicit view.
  24.  
  25. void     setContentView(View view, ViewGroup.LayoutParams params)
  26. Set the activity content to an explicit view.