All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.example.pocketknife.MultiAnnotationActivity Maven / Gradle / Ivy

The newest version!
package com.example.pocketknife;

import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import pocketknife.BindExtra;
import pocketknife.PocketKnife;
import pocketknife.SaveState;

public class MultiAnnotationActivity extends FragmentActivity {
    public static final String EXTRA_INT = "EXTRA_INT";

    @BindExtra(EXTRA_INT)
    @SaveState
    int i;

    MultiAnnotationFragment fragment;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.simple_activity);


        PocketKnife.bindExtras(this);
        PocketKnife.restoreInstanceState(this, savedInstanceState);
    }

    @Override
    protected void onSaveInstanceState(Bundle outState) {
        super.onSaveInstanceState(outState);
        PocketKnife.saveInstanceState(this, outState);
    }

    public void replaceFragment(MultiAnnotationFragment fragment) {
        this.fragment = fragment;
        getSupportFragmentManager().beginTransaction().replace(R.id.container, fragment).commit();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy