Skip to content

Instantly share code, notes, and snippets.

@hello2pal
hello2pal / MainActivity.java
Created January 19, 2013 13:00
Android is supporting Different Font Style import android.app.Activity;
import android.graphics.Typeface;
import android.os.Bundle;
import android.widget.TextView;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
/*
@hello2pal
hello2pal / activity_main.xml
Created January 19, 2013 12:46
Android is supporting Different Font Style
<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"
tools:context=".MainActivity" >
<TextView
android:id="@+id/text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@hello2pal
hello2pal / MainActivity.java
Created January 17, 2013 15:09
Sample Video Player
import android.app.Activity;
import android.os.Bundle;
import android.widget.MediaController;
import android.widget.VideoView;
public class MainActivity extends Activity {
VideoView videoView;
MediaController mediaController;
@hello2pal
hello2pal / activity_main.xml
Created January 17, 2013 14:58
Sample Video Player
<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"
tools:context=".MainActivity" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
@hello2pal
hello2pal / AnotherActivity.java
Last active December 11, 2015 05:08
Passing Data from One Activity to Another Activity
import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;
public class AnotherActivity extends Activity {
Bundle bundle;
String value;
TextView textView;
@hello2pal
hello2pal / MainActivity.java
Last active January 1, 2019 17:02
Passing Data from One Activity to Another Activity
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
public class MainActivity extends Activity {
@hello2pal
hello2pal / another_activity.xml
Created January 16, 2013 19:22
Passing Data from One Activity to Another Activity
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#2952CC" >
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
@hello2pal
hello2pal / activity_main.xml
Created January 16, 2013 19:13
Passing Data from One Activity to Another Activity
<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"
tools:context=".MainActivity" >
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@hello2pal
hello2pal / AndroidManifest.xml
Created January 16, 2013 19:09
How to Navigate from One Activity to Another Activity in Android
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.hello2pal.navigatetoanotheractivity"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="8" />
<application
android:icon="@drawable/ic_launcher"
@hello2pal
hello2pal / AnotherActivity.java
Created January 16, 2013 16:01
How to Navigate from One Activity to Another Activity in Android
import android.app.Activity;
import android.os.Bundle;
public class AnotherActivity extends Activity{
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.another_activity);