Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
package com.example.simplefragmentexample;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
public class LayOutTwo extends Fragment {
ViewGroup root;
public View onCreateView(LayoutInflater inflater, ViewGroup container,Bundle savedInstanceState) {
root = (ViewGroup) inflater.inflate(R.layout.layout_two, null);
return root;
void setMessage(String msg){
TextView txt=(TextView)root.findViewById(;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.