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" | |
android:paddingBottom="@dimen/activity_vertical_margin" | |
android:paddingLeft="@dimen/activity_horizontal_margin" | |
android:paddingRight="@dimen/activity_horizontal_margin" | |
android:paddingTop="@dimen/activity_vertical_margin" | |
tools:context="com.gmsetiawan.droidclass.MainActivity$PlaceholderFragment" > |
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.gmsetiawan.droidclass; | |
import java.util.Arrays; | |
import android.support.v7.app.ActionBarActivity; | |
import android.support.v4.app.Fragment; | |
import android.content.Intent; | |
import android.os.Bundle; | |
import android.util.Log; | |
import android.view.LayoutInflater; |
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
Don't forget to add app_id at string.xml | |
<?xml version="1.0" encoding="utf-8"?> | |
<resources> | |
... | |
<string name="app_id">272943959560173</string> | |
</resources> | |
then add meta and activity at manifest |
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
public static class PlaceholderFragment extends Fragment { | |
public PlaceholderFragment() { | |
} | |
@Override | |
public View onCreateView(LayoutInflater inflater, ViewGroup container, | |
Bundle savedInstanceState) { | |
View rootView = inflater.inflate(R.layout.fragment_main, container, false); | |
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 ActivityTwo extends Activity { | |
TextView tvReceived; | |
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.content.Intent; | |
import android.os.Bundle; | |
import android.view.View; | |
import android.widget.Button; | |
import android.widget.EditText; | |
public class MainActivity extends Activity { |
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
public class MyActivity extends Activity implements View.OnClickListener { | |
Button button1, button2, button3; | |
@Override | |
public void onCreate(Bundle bundle) { | |
super.onCreate(); | |
/.../ | |
button1 = (Button) findViewById(R.id.button1); | |
button2 = (Button) findViewById(R.id.button2); |
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.view.View; | |
import android.widget.AdapterView; | |
import android.widget.AdapterView.OnItemSelectedListener; | |
import android.widget.ArrayAdapter; | |
import android.widget.Button; | |
import android.widget.Spinner; |
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
final TextView tvRate = (TextView) findViewById(R.id.textView6); | |
RatingBar rbRate = (RatingBar) findViewById(R.id.ratingBar1); | |
rbRate.setOnRatingBarChangeListener(new OnRatingBarChangeListener() { | |
@Override | |
public void onRatingChanged(RatingBar ratingBar, float rating, | |
boolean fromUser) { | |
// TODO Auto-generated method stub | |
tvRate.setText(String.valueOf(rating)); | |
} |
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
public class FormWidgetActivity extends Activity{ | |
private Handler progressBarHandler = new Handler(); | |
ProgressBar mProgressBar, mProgressBarHorizontal; | |
int iProgressBarStatus = 0; | |
TextView tvStatusProgressBar; | |
@Override |
NewerOlder