Created
April 15, 2014 12:02
-
-
Save CoffeeCode/10726670 to your computer and use it in GitHub Desktop.
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
package com.ap.wificam.ImageDetails; | |
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.TextView; | |
import com.ap.wificam.R; | |
public class MyFragment extends Fragment { | |
public static final String EXTRA_MESSAGE = "EXTRA_MESSAGE"; | |
public static final MyFragment newInstance(String message) | |
{ | |
MyFragment f = new MyFragment(); | |
Bundle bdl = new Bundle(1); | |
bdl.putString(EXTRA_MESSAGE, message); | |
f.setArguments(bdl); | |
return f; | |
} | |
@Override | |
public View onCreateView(LayoutInflater inflater, ViewGroup container, | |
Bundle savedInstanceState) { | |
String message = getArguments().getString(EXTRA_MESSAGE); | |
View v = inflater.inflate(R.layout.myfragment_layout, container, false); | |
TextView messageTextView = (TextView)v.findViewById(R.id.textView); | |
messageTextView.setText(message); | |
return v; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment