This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.droidclass; | |
import android.app.Activity; | |
import android.os.Bundle; | |
public class MainActivity extends Activity { | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.droidclass; | |
import android.support.v7.app.ActionBarActivity; | |
import android.support.v4.app.Fragment; | |
import android.os.Bundle; | |
import android.view.LayoutInflater; | |
import android.view.Menu; | |
import android.view.MenuItem; | |
import android.view.View; | |
import android.view.ViewGroup; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:id="@+id/container" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
tools:context="com.example.droidclass.MainActivity" | |
tools:ignore="MergeRootFrame" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent"> | |
<TextView | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:text="@string/hello_world" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.droidclass; | |
import android.app.Activity; | |
import android.os.Bundle; | |
import android.widget.TextView; | |
public class FormWidgetActivity extends Activity{ | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Spinner spinFromString = (Spinner) findViewById(R.id.spinner1); | |
ArrayAdapter<CharSequence> adapter = | |
ArrayAdapter.createFromResource(FormWidgetActivity.this, | |
R.array.country_array, android.R.layout.simple_spinner_item); | |
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); | |
spinFromString.setAdapter(adapter); | |
spinFromString.setOnItemSelectedListener(new OnItemSelectedListener() { | |
@Override |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Spinner spinFromList = (Spinner) findViewById(R.id.spinner2); | |
List<String> list = new ArrayList<String>(); | |
list.add("Indonesia"); | |
list.add("England"); | |
list.add("USA"); | |
list.add("Franch"); | |
ArrayAdapter<String> dataAdapter = new ArrayAdapter<String>(this,android.R.layout.simple_spinner_item, list); | |
dataAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); | |
spinFromList.setAdapter(dataAdapter); | |
OlderNewer