Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class callActivity extends AppCompatActivity {
- Button acceptCall;
- Button delinceCall;
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_call);
- Window window = getWindow();
- window.addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED
- | WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON
- | WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
- acceptCall = findViewById(R.id.answer_call_btn);
- delinceCall = findViewById(R.id.reject_call_btn);
- try {
- Uri notification = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_RINGTONE);
- Ringtone r = RingtoneManager.getRingtone(getApplicationContext(), notification);
- r.play();
- } catch (Exception e) {
- e.printStackTrace();
- }
- acceptCall.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- sendToVideoCall();
- }
- });
- }
- private void sendToVideoCall() {
- Intent mainIntent = new Intent(callActivity.this, videoCallActivity.class);
- startActivity(mainIntent);
- finish();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement