Skip to content

Instantly share code, notes, and snippets.

@manishkpr
Created December 30, 2016 05:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save manishkpr/4eea0fe1890cc4f044725c2f743bd309 to your computer and use it in GitHub Desktop.
Save manishkpr/4eea0fe1890cc4f044725c2f743bd309 to your computer and use it in GitHub Desktop.
package com.example.simplefragmentexample;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
public class MainActivity extends FragmentActivity implements OnButtonPressListener{
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
@Override
public void onButtonPressed(String msg) {
// TODO Auto-generated method stub
LayOutTwo Obj=(LayOutTwo) getSupportFragmentManager().findFragmentById(R.id.frag_2);
Obj.setMessage(msg);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment