Skip to main content

Posts

Showing posts from October, 2015

Android: Create a PopUp Window Example

MainActivity.java package com.example.popupwindow; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.Menu; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; public class MainActivity extends Activity {    Button btn;

Android Simple Fragment Example

For creating a fragment we only use two things:- Fragment class Fragment xml layout In the below discussed example we need to show different fragments on button click event. So, we will be creating two layout files and two different classes. Here goes the code for first Fragment: FirstFragment.java package com.example.fragementdemo; import android.app.Fragment; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; public class FirstFragment extends Fragment {