Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. package com.example.filip.ispit_android;
  2.  
  3. import android.content.Intent;
  4. import android.support.v7.app.AppCompatActivity;
  5. import android.os.Bundle;
  6. import android.widget.TextView;
  7.  
  8. public class Poslana_Poruka extends AppCompatActivity {
  9.  
  10. private TextView tvBroj;
  11. private TextView tvPoruka;
  12.  
  13. @Override
  14. protected void onCreate(Bundle savedInstanceState) {
  15. super.onCreate(savedInstanceState);
  16. setContentView(R.layout.activity_poslana__poruka);
  17.  
  18. initWidgets();
  19. findIntent();
  20.  
  21.  
  22. }
  23.  
  24. private void initWidgets() {
  25. tvBroj=findViewById(R.id.tvBroj);
  26. tvPoruka=findViewById(R.id.tvPoruka);
  27. }
  28. private void findIntent() {
  29. Intent broj = getIntent();
  30. if (broj !=null && broj.hasExtra(MainActivity.PHONE_NUMBER)){
  31. String brTelefona = broj.getStringExtra(MainActivity.PHONE_NUMBER);
  32. tvBroj.setText(brTelefona);
  33. }
  34. Intent poruka = getIntent();
  35. if (poruka !=null && poruka.hasExtra(MainActivity.TEXT_MESSAGE)){
  36. String textPoruke = poruka.getStringExtra(MainActivity.TEXT_MESSAGE);
  37. tvPoruka.setText(textPoruke);
  38. }
  39. }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement