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
07-29 18:18:41.969 4309-4309/com.example.android.environmentalnews E/dalvikvm: Could not find class 'android.support.v4.view.ViewCompat$OnUnhandledKeyEventListenerWrapper', referenced from method android.support.v4.view.ViewCompat.addOnUnhandledKeyEventListener | |
07-29 18:18:41.979 4309-4309/com.example.android.environmentalnews E/dalvikvm: Could not find class 'android.view.WindowInsets', referenced from method android.support.v4.view.ViewCompat.dispatchApplyWindowInsets | |
07-29 18:18:41.989 4309-4309/com.example.android.environmentalnews E/dalvikvm: Could not find class 'android.view.WindowInsets', referenced from method android.support.v4.view.ViewCompat.onApplyWindowInsets | |
07-29 18:18:41.999 4309-4309/com.example.android.environmentalnews E/dalvikvm: Could not find class 'android.view.View$OnUnhandledKeyEventListener', referenced from method android.support.v4.view.ViewCompat.removeOnUnhandledKeyEventListener | |
07-29 18:18:42.009 4309-4309/com.example.android.environmentalnews E/dalvikvm: Could not find class ' |
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
// For pub Fragment | |
public Place(String name, String address, String price, String description) { | |
this.name = name; | |
this.address = address; | |
this.price = price; | |
this.description = description; | |
} | |
public Place(String name, int placeImageResourceId, String address, String price, String description) { | |
this.name = name; |
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
@Override | |
public View onCreateView(LayoutInflater inflater, ViewGroup container, | |
Bundle savedInstanceState) { | |
View rootView = inflater.inflate(R.layout.place_list, container, false); | |
final ArrayList<Place> places = new ArrayList<Place>(); | |
places.add(new Place(getString(R.string.church_name_1), getString(R.string.church_address_1), "a", | |
getString(R.string.church_address_1))); |
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
@Override | |
public View getView(int position, View convertView, ViewGroup parent) { | |
// Check if an existing view is being reused, otherwise inflate the view | |
if (convertView == null) { | |
convertView = LayoutInflater.from(getContext()).inflate(R.layout.list_item_place, parent, false); | |
} | |
// Get the {@link Place} object located at this position in the list | |
Place currentPlace = getItem(position); |
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
//Saves data before changing activity | |
@Override | |
public void onSaveInstanceState(Bundle savedInstanceState) { | |
savedInstanceState.putString(PLAYER_1_NAME, playerAName); | |
savedInstanceState.putString(PLAYER_2_NAME, playerBName); | |
savedInstanceState.putInt(SCORE_A, scorePlayerA); | |
savedInstanceState.putInt(SCORE_B, scorePlayerB); | |
super.onSaveInstanceState(savedInstanceState); | |
} |
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
<?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:orientation="vertical" | |
tools:context="com.example.android.helloandroid.MainActivity"> | |
<RelativeLayout |
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
<?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="wrap_content" | |
android:layout_height="match_parent" | |
android:orientation="horizontal" | |
tools:context="com.example.android.helloandroid.MainActivity"> | |
<RelativeLayout |