Android Lab Exercises

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 30

Seekbar

MainActivity.java
package com.saya.seekbar;

import android.os.Bundle;
import android.app.Activity;
import android.graphics.Color;
import android.view.Menu;
import android.widget.RelativeLayout;
import android.widget.SeekBar;
import android.widget.SeekBar.OnSeekBarChangeListener;

/* Add "implements OnSeekBarChangeListener" and "Add Unimplemented Method" to


MainActivity */

public class MainActivity extends Activity implements OnSeekBarChangeListener {


SeekBar red, green, blue; // Three SeekBars
RelativeLayout MainScreen;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
MainScreen=(RelativeLayout) findViewById(R.id.screen);
/* id's for SeekBars */
red=(SeekBar)findViewById(R.id.seekBar1);
green=(SeekBar) findViewById(R.id.seekBar2);
blue=(SeekBar)findViewById(R.id.seekBar3);
/* Current objects of colors(SeekBars) */
red.setOnSeekBarChangeListener(this);
green.setOnSeekBarChangeListener(this);
blue.setOnSeekBarChangeListener(this);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser)
{
// TODO Auto-generated method stub
MainScreen.setBackgroundColor(Color.rgb(red.getProgress(),
green.getProgress(), blue.getProgress()));
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
// TODO Auto-generated method stub
}
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
// TODO Auto-generated method stub
}
}

Output:
ListView
MainActivity.java
package com.e.listview;

import android.os.Bundle;
import android.app.Activity;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.Toast;

public class MainActivity extends Activity {


String[] months= {"January", "February", "March", "April", "May", "June",
"July","August", "september","October", "November", "December"};
ListView lv;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
lv=(ListView)findViewById(R.id.listview);
ArrayAdapter<String> adapter=new
ArrayAdapter<String>(getApplicationContext(),
android.R.layout.simple_expandable_list_item_1, months);
lv.setAdapter(adapter);
lv.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int
position, long id) {
// TODO Auto-generated method stub
Toast.makeText(getApplicationContext(), months[position],
Toast.LENGTH_SHORT).show();
}
});
}
}
Calculator
MainActivity.java
package com.saya.simplecalculator;

import android.os.Bundle;
import android.app.Activity;
import android.widget.EditText;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.RadioGroup.OnCheckedChangeListener;

public class MainActivity extends Activity implements OnCheckedChangeListener {


EditText et1, et2, et3;
RadioGroup rg;
RadioButton rb0, rb1, rb2, rb3;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

et1=(EditText) findViewById(R.id.editText1);
et2=(EditText) findViewById(R.id.editText2);
et3=(EditText) findViewById(R.id.editText3);

rg=(RadioGroup) findViewById(R.id.radioGroup1);
rb0=(RadioButton) findViewById(R.id.radio0);
rb1=(RadioButton) findViewById(R.id.radio1);
rb2=(RadioButton) findViewById(R.id.radio2);
rb3=(RadioButton) findViewById(R.id.radio3);

rg.setOnCheckedChangeListener(this);
}

@Override
public void onCheckedChanged(RadioGroup group, int arg1) {
// TODO Auto-generated method stub
float n1, n2, n3=0;
n1=Float.parseFloat(et1.getText().toString());
n2=Float.parseFloat(et2.getText().toString());

if(arg1 == rb0.getId())
n3=n1+n2;
else if(arg1 == rb1.getId())
n3=n1-n2;
else if(arg1 == rb2.getId())
n3=n1*n2;
else if(arg1 == rb3.getId())
n3=n1/n2;
et3.setText(n3+"");
}
}
File Read and Write
MainActivity.java
package com.ic.filereadwrite;

import android.os.Bundle;

import java.io.BufferedReader;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import android.app.Activity;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

public class MainActivity extends Activity {


Button btnsave,btnclear,btnload,btnclose;
EditText et;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

et=(EditText)findViewById(R.id.editText1);
btnsave=(Button)findViewById(R.id.btnsave);
btnload=(Button)findViewById(R.id.btnload);
btnclear=(Button)findViewById(R.id.btnclear);
btnclose=(Button)findViewById(R.id.btnclose);

btnsave.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
try {
FileOutputStream fos=openFileOutput("myfile", MODE_PRIVATE);
fos.write(et.getText().toString().getBytes());
fos.close();
Toast.makeText(getApplicationContext(), "File Saved", Toast.LENGTH_SHORT).show();
} catch (Exception e) {
Toast.makeText(getApplicationContext(), e.getMessage(), Toast.LENGTH_SHORT).show();
e.printStackTrace();
}
}
});
btnclear.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
et.setText("");
}
});
btnload.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
try {
BufferedReader reader = new BufferedReader(new
InputStreamReader(openFileInput("myfile")));
String textline;
StringBuffer strbuffer=new StringBuffer();
while( (textline=reader.readLine()) != null){
strbuffer.append(textline+"\n");
}
et.setText(strbuffer.toString());
} catch (Exception e) {
Toast.makeText(getApplicationContext(), e.getMessage(), Toast.LENGTH_SHORT).show();
e.printStackTrace(); }
}
});
btnclose.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
finish();
}
});
}
}
IntentActivity
MainActivity.java
package com.saya.intentapp;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

public class MainActivity extends Activity {


Button button;
EditText et;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
et=(EditText) findViewById(R.id.editText1);
button=(Button) findViewById(R.id.button1);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
Intent intent = new Intent(getApplicationContext(),
SecondActivity.class);
intent.putExtra("id", et.getText().toString());
startActivity(intent);
}
});
}
}

SecondActivity.java
package com.saya.intentapp;

import android.os.Bundle;
import android.app.Activity;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

public class SecondActivity extends Activity {


TextView tv;
Button bt;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_second);
tv=(TextView) findViewById(R.id.textView1);
tv.setText(getIntent().getExtras().getString("id").toString());
bt=(Button) findViewById(R.id.button1);
bt.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
finish();
}
});
}
}
Status Bar Notification
MainActivity.java
package com.ic.statusbarnotification;

import android.os.Bundle;
import android.app.Activity;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class MainActivity extends Activity {


@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Button btn = (Button)findViewById(R.id.button1);
btn.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
NotificationManager nm= (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
Notification notification= new
Notification(android.R.drawable.stat_notify_more,"You have got an email",
System.currentTimeMillis());
Context context=MainActivity.this;
Intent intent = new Intent(context,MainActivity.class);
PendingIntent pending = PendingIntent.getActivity(getApplicationContext(), 0,
intent, 0);
notification.setLatestEventInfo(context, "Email from facebook", "You have 4
friends request", pending);
nm.notify(0, notification); // zero is the notification id.
}
});
}
}
Splash Screen
MainActivity.java
package com.saya.splashscreen;

import android.os.Bundle;
import android.os.Handler;
import android.app.Activity;
import android.content.Intent;

public class MainActivity extends Activity {


@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Handler myhandler = new Handler();
myhandler.postDelayed(new Runnable() {
@Override
public void run() {
// TODO Auto-generated method stub
finish();
Intent myintent = new Intent(MainActivity.this, SecondActivity.class);
startActivity(myintent);
}
}, 4000); // this is 4 seconds
}
}

SecondActivity.java
package com.saya.splashscreen;

import android.os.Bundle;
import android.app.Activity;

public class SecondActivity extends Activity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_second);
}
}
Alert Dialog
MainActivity.java
package com.ic.alertdialogs;

import android.os.Bundle;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.Toast;

public class MainActivity extends Activity implements OnClickListener {


Button btn1,btn2,btn3;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

btn1=(Button)findViewById(R.id.button1);
btn2=(Button)findViewById(R.id.button2);
btn3=(Button)findViewById(R.id.button3);
btn1.setOnClickListener(this);
btn2.setOnClickListener(this);
btn3.setOnClickListener(this);
}
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
switch(v.getId())
{
case R.id.button1:
showdialog1();
break;
case R.id.button2:
showdialog2();
break;
case R.id.button3:
showdialog3();
break;
}
}
private void showdialog1() {
AlertDialog.Builder builder=new AlertDialog.Builder(this);
builder.setTitle("Confirm Delete");
builder.setMessage("Are You sure to Delete?");
builder.setPositiveButton("Yes", new DialogInterface.OnClickListener() {

@Override
public void onClick(DialogInterface dialog, int which) {
Toast.makeText(getApplicationContext(), "Yes is Selected",
Toast.LENGTH_SHORT).show();
}
});
builder.setNegativeButton("No", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface arg0, int arg1) {
Toast.makeText(getApplicationContext(), "No is Selected",
Toast.LENGTH_SHORT).show();
}
});
AlertDialog mydialog = builder.create();
mydialog.show();
}
private void showdialog2() {
AlertDialog.Builder builder=new AlertDialog.Builder(this);
final String[] colors={"Red","Green","Blue","Cyan","Yellow","Pink"};
builder.setTitle("Select a Color ");
builder.setItems(colors, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
Toast.makeText(getApplicationContext(), colors[which],
Toast.LENGTH_SHORT).show();
}
});
AlertDialog mydialog = builder.create();
mydialog.show();
}
private void showdialog3() {
AlertDialog.Builder builder=new AlertDialog.Builder(this);
final String[] colors={"Red","Green","Blue","Cyan","Yellow","Pink"};
builder.setTitle("Select a Color ");
builder.setSingleChoiceItems(colors, -1, new
DialogInterface.OnClickListener() {

@Override
public void onClick(DialogInterface dialog, int which) {
Toast.makeText(getApplicationContext(), colors[which],
Toast.LENGTH_SHORT).show();
}
});
AlertDialog mydialog = builder.create();
mydialog.show();
}
}
Tab Widget Talking Clock
MainActivity.java
package com.ic.talkingclock;

import android.os.Bundle;
import android.speech.tts.TextToSpeech;
import android.speech.tts.TextToSpeech.OnInitListener;
import java.util.Calendar;
import android.app.Activity;
import android.app.TabActivity;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.AnalogClock;
import android.widget.TabHost;
import android.widget.Toast;

public class MainActivity extends TabActivity implements OnInitListener{


AnalogClock ac;
TextToSpeech tts;
int h,m,s;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
TabHost mytabHost=getTabHost();

mytabHost.addTab(mytabHost.newTabSpec("tab1").setIndicator("AnalogClock").setContent(
R.id.tab1));

mytabHost.addTab(mytabHost.newTabSpec("tab2").setIndicator("DigitalClock").setContent
(R.id.tab2));
ac=(AnalogClock)findViewById(R.id.analogClock1);
tts=new TextToSpeech(this, this);
ac.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Calendar c = Calendar.getInstance();
h=c.get(Calendar.HOUR);
m=c.get(Calendar.MINUTE);
s=c.get(Calendar.SECOND);
String t="The time is "+h+" Hours"+m+" Minutes"+s+" Seconds";
Toast.makeText(getApplicationContext(), t, Toast.LENGTH_LONG).show();
tts.speak(t, TextToSpeech.QUEUE_FLUSH, null);
}
});
}
@Override
public void onInit(int status) {
// TODO Auto-generated method stub

}
}
Multi Language List
MainActivity.java
package com.saya.multi;

import android.os.Bundle;
import android.app.Activity;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.Toast;

public class MainActivity extends Activity {


ListView lv;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

lv=(ListView)findViewById(R.id.listView1);
final ArrayAdapter<CharSequence>
myadapter = ArrayAdapter.createFromResource(getApplicationContext(),
R.array.days ,android.R.layout.simple_list_item_1);
lv.setAdapter(myadapter);
lv.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int
position, long id) {
// TODO Auto-generated method stub
Toast.makeText(getApplicationContext(),
myadapter.getItem(position), Toast.LENGTH_SHORT).show();
}
});
}
}
WebView
MainActivity.java
package com.saya.webview;

import android.os.Bundle;
import android.app.Activity;
import android.view.View;
import android.view.View.OnClickListener;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.Button;
import android.widget.NumberPicker;

public class MainActivity extends Activity {


NumberPicker np;
Button btn;
WebView wv;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

String[] myarray={"Mypage","Google","Yahoo","Bing"};
np=(NumberPicker) findViewById(R.id.numberPicker1);
np.setDisplayedValues(myarray);
np.setMinValue(0);
np.setMaxValue(myarray.length-1);
wv=(WebView) findViewById(R.id.webView1);
btn=(Button) findViewById(R.id.button1);

btn.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
int choice=np.getValue();
if(choice==0)
wv.loadUrl("file:///android_asset/mypage.html");
else if(choice==1){
wv.setWebViewClient(new WebViewClient());
wv.loadUrl("https://www.google.co.in");
}
else if(choice==2)
wv.loadUrl("https://www.yahoo.com");
else if(choice==3)
wv.loadUrl("https://www.bing.com");
}
});
}
}
Tween Animation
MainActivity.java

package com.pa.tween;

import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.TextView;

public class MainActivity extends Activity {


@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
final TextView tv=(TextView) findViewById(R.id.textView1);
tv.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
Animation anim=AnimationUtils.loadAnimation(getApplicationContext(), R.anim.anim);
tv.startAnimation(anim);
}
});
}

Anim.xml:
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<rotate android:fromDegrees="0"
android:toDegrees="360"
android:pivotX="50%"
android:pivotY="50%"
android:duration="4000"
android:startOffset="2000"/>
</set>
Tab Widget Talking Clock
MainActivity.java
package com.pa.talkingclock;

import java.util.Calendar;
import android.os.Bundle;
import android.app.Activity;
import android.app.TabActivity;
import android.speech.tts.TextToSpeech;
import android.speech.tts.TextToSpeech.OnInitListener;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.AnalogClock;
import android.widget.TabHost;
import android.widget.Toast;

public class MainActivity extends TabActivity implements


OnClickListener ,OnInitListener {
AnalogClock ac;
int h,m,s;
TextToSpeech tts;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ac=(AnalogClock)findViewById(R.id.analogClock1);
ac.setOnClickListener(this);
tts=new TextToSpeech(this,this);
TabHost myhost=getTabHost();

myhost.addTab(myhost.newTabSpec("tab1").setIndicator("AnalogueClock").setContent(R.id
.tab1));

myhost.addTab(myhost.newTabSpec("tab2").setIndicator("DigitalClock").setContent(R.id.
tab2));
}

@Override
public void onClick(View v) {
Calendar c=Calendar.getInstance();
h=c.get(Calendar.HOUR);
m=c.get(Calendar.MINUTE);
s=c.get(Calendar.SECOND);
String st="The time is "+String.valueOf(h)+"Hours"+String.valueOf(m)
+"minutes"+String.valueOf(s)+"seconds";
Toast.makeText(getApplicationContext(),st,Toast.LENGTH_SHORT).show();
tts.speak(st, TextToSpeech.QUEUE_FLUSH, null);
}

}
Shared Preference
MainActivity.java
package com.ic.sharedpreference;

import android.os.Bundle;
import android.app.Activity;
import android.content.SharedPreferences;
import android.widget.EditText;

public class MainActivity extends Activity {


EditText et1, et2;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

et1=(EditText) findViewById(R.id.editText1);
et2=(EditText) findViewById(R.id.editText2);
SharedPreferences settings = getSharedPreferences("MYPREFS", 0);
et1.setText(settings.getString("name", ""));
et2.setText(settings.getString("email", ""));
}
@Override
protected void onStop() {
super.onStop();
SharedPreferences settings = getSharedPreferences("MYPREFS", 0);
SharedPreferences.Editor editor = settings.edit();
editor.putString("name", et1.getText().toString());
editor.putString("email",
et2.getText().toString());
editor.commit();
}
}
GridView
MainActivity.java
package com.example.exgridview;

import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v7.app.ActionBarActivity;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.GridView;
public class MainActivity extends ActionBarActivity {
GridView gv;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
gv=(GridView)findViewById(R.id.gridView1);
gv.setAdapter(new myadapter(this));
gv.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
Intent i=new Intent(getApplicationContext(),FullScreenActivity.class);
i.putExtra("id", arg2);
startActivity(i);
}
});
}
}

myadapter.java
package com.example.exgridview;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.GridView;
import android.widget.ImageView;
import android.widget.ListAdapter;
public class myadapter extends BaseAdapter implements ListAdapter {
private Context context;
public Integer[]
myimages={R.drawable.pic_1,R.drawable.pic_2,R.drawable.pic_3};
public myadapter(Context c) {
context=c;
}
@Override
public int getCount() {
// TODO Auto-generated method stub
return myimages.length;
}
@Override
public Object getItem(int arg0) {
// TODO Auto-generated method stub
return null;
}
@Override
public long getItemId(int arg0) {
// TODO Auto-generated method stub
return 0;
}
@Override
public View getView(int arg0, View arg1, ViewGroup arg2) {
ImageView iv=new ImageView(context);
iv.setImageResource(myimages[arg0]);
iv.setLayoutParams(new GridView.LayoutParams(200,200));
return iv;
}
}

Fullscreenactivity.java
package com.example.exgridview;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v7.app.ActionBarActivity;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

public class FullScreenActivity extends ActionBarActivity {


ImageView iv;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_full_screen);
iv=(ImageView)findViewById(R.id.imageView1);
int position=getIntent().getExtras().getInt("id");
myadapter ma=new myadapter(this);
iv.setImageResource(ma.myimages[position]);

if (savedInstanceState == null) {
getSupportFragmentManager().beginTransaction().add(R.id.container, new
PlaceholderFragment()).commit();
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.full_screen, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
/**
* A placeholder fragment containing a simple view.
*/
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_full_screen,
container, false);
return rootView;
}
}

You might also like