Created
April 2, 2018 15:12
-
-
Save alitamoor65/7167daa118f3bbfde147ea8e1ed19b0e to your computer and use it in GitHub Desktop.
This file contains hidden or 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
<?xml version="1.0" encoding="utf-8"?> | |
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:layout_margin="10dp" | |
android:orientation="horizontal" | |
tools:context="com.tutorialscafe.readallsms.MainActivity"> | |
<fragment android:name="com.tutorialscafe.readallsms.BlankFragment" | |
android:id="@+id/article_fragment" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" /> | |
</LinearLayout> |
This file contains hidden or 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.tutorialscafe.readallsms; | |
import android.os.Bundle; | |
import android.support.v7.app.AppCompatActivity; | |
import android.view.ContextMenu; | |
import android.view.MenuItem; | |
import android.view.View; | |
import android.widget.ArrayAdapter; | |
import android.widget.ListView; | |
import android.widget.Toast; | |
public class MainActivity extends AppCompatActivity { | |
ListView listView1; | |
String contacts[]={"Amir Tanveer","Fakhar Husnnain","Muh Adeel","Ali Tamoor","Nayyer Abbas","Asad Nawaz","Ahsan Riaz","Awais Shahid"}; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
} | |
} |
This file contains hidden or 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:layout_width="match_parent" | |
android:layout_height="match_parent" | |
tools:context="com.tutorialscafe.readallsms.BlankFragment"> | |
<!-- TODO: Update blank fragment layout --> | |
<ListView | |
android:id="@+id/listView1" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content"></ListView> | |
</FrameLayout> |
This file contains hidden or 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.tutorialscafe.readallsms; | |
import android.os.Bundle; | |
import android.support.v4.app.Fragment; | |
import android.view.LayoutInflater; | |
import android.view.View; | |
import android.view.ViewGroup; | |
import android.widget.ArrayAdapter; | |
import android.widget.ListView; | |
public class BlankFragment extends Fragment { | |
ListView listView1; | |
String contacts[]={"Amir Tanveer","Fakhar Husnnain","Muh Adeel","Ali Tamoor","Nayyer Abbas","Asad Nawaz","Ahsan Riaz","Awais Shahid"}; | |
@Override | |
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { | |
View view = inflater.inflate(R.layout.fragment_blank, container, false); | |
// Inflate the layout for this fragment | |
listView1 = (ListView) view.findViewById(R.id.listView1); | |
listView1.setAdapter( new ArrayAdapter<String>(view.getContext(),android.R.layout.simple_list_item_1,contacts)); | |
return view; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment