Showing posts with label Activity. Show all posts
Showing posts with label Activity. Show all posts

Monday, 7 March 2016

Android: No Title Bar in Activity

17:40:00 Posted by Kumanan ,
<style name="AppTheme" parent="@style/Theme.AppCompat.Light">
    <item name="windowNoTitle">true</item>
    <item name="windowActionBar">false</item>
    <item name="android:windowFullscreen">false</item>
    <item name="android:windowContentOverlay">@null</item>
</style>

Wednesday, 9 December 2015

Send data from activity to fragment in android

11:17:00 Posted by Kumanan , ,
From Activity you send data with intent as:

Bundle bundle = new Bundle();
bundle.putString("edttext", "From Activity");
// set Fragmentclass Arguments
Fragmentclass fragobj = new Fragmentclass();
fragobj.setArguments(bundle);


and in Fragment onCreateView method:

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
        Bundle savedInstanceState) {
    String strtext = getArguments().getString("edttext");    
    return inflater.inflate(R.layout.fragment, container, false);
}