Skip to content

Instantly share code, notes, and snippets.

@hellosagar
Created April 26, 2019 10:57
Show Gist options
  • Save hellosagar/7f449bf92b07795f222d7a50ca37921d to your computer and use it in GitHub Desktop.
Save hellosagar/7f449bf92b07795f222d7a50ca37921d to your computer and use it in GitHub Desktop.
package com.wotinstitutes.greetings;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.Toast;
public class Main2Activity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main2);
Intent intent = getIntent();
int id =intent.getIntExtra("a",0);
Toast.makeText(getApplicationContext(),String.valueOf(id).toString() ,Toast.LENGTH_LONG).show();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment