Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package net.simonvt.messagebar.samples;
 
 
public class SampleActivity extends Activity implements MessageBar.OnMessageClickListener {
    private static final String STATE_MESSAGEBAR = "net.simonvt.messagebar.samples.SampleActivity.messageBar";
    private static final String STATE_COUNT = "net.simonvt.messagebar.samples.SampleActivity.count";
    private MessageBar mMessageBar;
    private TextView mTextView;
    private int mCount;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(..);
         = new MessageBar(this);
        .setOnClickListener(this);
            @Override
            public void onClick(View v) {
                .show("Message #" + );
                ++;
            }
        });
            @Override
            public void onClick(View v) {
                Bundle b = new Bundle();
                b.putInt("count");
                .show("Message #" + "Button!"..b);
                ++;
            }
        });
    }
    @Override
    protected void onRestoreInstanceState(Bundle inState) {
        super.onRestoreInstanceState(inState);
         = inState.getInt();
    }
    @Override
    protected void onSaveInstanceState(Bundle outState) {
        super.onSaveInstanceState(outState);
        outState.putInt();
    }
    @Override
    public void onMessageClick(Parcelable token) {
        Bundle b = (Bundletoken;
        final int count = b.getInt("count");
        .setText("You clicked message #" + count);
    }
New to GrepCode? Check out our FAQ X