MessengerPigeon/app2/src/main/java/com/epicstudios/messengerpigeon/DisplayGroupActivity.java
@TargetApi(Build.VERSION_CODES.M)
    public void onSendClick(View view) {
        String message = input.getText().toString();
        List<Pair<Long, String>> peoples = new ArrayList<>();
        for(int x = 0; x < listPeople.size(); x++) {
            if(!contactAdapter.isChecked(x)){ peoples.add(listPeople.get(x)); }
        }
        if (ContextCompat.checkSelfPermission(this, Manifest.permission.SEND_SMS)
                != PackageManager.PERMISSION_GRANTED) {
            Log.w(TAG, "getting permissions to send sms");
            if (ContextCompat.checkSelfPermission(this, Manifest.permission.SEND_SMS)
                    != PackageManager.PERMISSION_GRANTED) {
                if (shouldShowRequestPermissionRationale(Manifest.permission.SEND_SMS)) {
                    Toast.makeText(this, "Need permissions to send message", Toast.LENGTH_LONG).show();
                }
                requestPermissions(new String[]{Manifest.permission.SEND_SMS},
                        SEND_SMS_PERMISSIONS_REQUEST);
            }
        } else { presenter.addConversation(peoples, message); input.setText(""); }

        /*if (ContextCompat.checkSelfPermission(this, android.Manifest.permission.SEND_SMS)//TODO mms
                != PackageManager.PERMISSION_GRANTED) {
            //getPermissionToReadSMS(); This should be in a fragment activity
        }*/
    }
/**
     * checks for permissions then calls the send function in presenter
     * @param view the button
     */
checks for permissions then calls the send function in presenter
@param view the button
checks for permissions then calls the send function in presenter @param view the button
@TargetApi(Build.VERSION_CODES.M)
    public void onSendClick(View view) {
        String message = input.getText().toString();
        List<Pair<Long, String>> peoples = new ArrayList<>();
        for(int x = 0; x < listPeople.size(); x++) {
            if(!contactAdapter.isChecked(x)){ peoples.add(listPeople.get(x)); }
        }
        if (ContextCompat.checkSelfPermission(this, Manifest.permission.SEND_SMS)
                != PackageManager.PERMISSION_GRANTED) {
            Log.w(TAG, "getting permissions to send sms");
            if (ContextCompat.checkSelfPermission(this, Manifest.permission.SEND_SMS)
                    != PackageManager.PERMISSION_GRANTED) {
                if (shouldShowRequestPermissionRationale(Manifest.permission.SEND_SMS)) {
                    Toast.makeText(this, "Need permissions to send message", Toast.LENGTH_LONG).show();
                }
                requestPermissions(new String[]{Manifest.permission.SEND_SMS},
                        SEND_SMS_PERMISSIONS_REQUEST);
            }
        } else { presenter.addConversation(peoples, message); input.setText(""); }
        /*if (ContextCompat.checkSelfPermission(this, android.Manifest.permission.SEND_SMS)//TODO mms
                != PackageManager.PERMISSION_GRANTED) {
            //getPermissionToReadSMS(); This should be in a fragment activity
        }*/
    }
@ TargetApi ( Build . VERSION_CODES . M ) public void onSendClick ( View view ) { String message = input . getText ( ) . toString ( ) ; List < Pair < Long , String > > peoples = new ArrayList < > ( ) ; for ( int x = 0 ; x < listPeople . size ( ) ; x ++ ) { if ( ! contactAdapter . isChecked ( x ) ) { peoples . add ( listPeople . get ( x ) ) ; } } if ( ContextCompat . checkSelfPermission ( this , Manifest . permission . SEND_SMS ) != PackageManager . PERMISSION_GRANTED ) { Log . w ( TAG , "getting permissions to send sms" ) ; if ( ContextCompat . checkSelfPermission ( this , Manifest . permission . SEND_SMS ) != PackageManager . PERMISSION_GRANTED ) { if ( shouldShowRequestPermissionRationale ( Manifest . permission . SEND_SMS ) ) { Toast . makeText ( this , "Need permissions to send message" , Toast . LENGTH_LONG ) . show ( ) ; } requestPermissions ( new String [ ] { Manifest . permission . SEND_SMS } , SEND_SMS_PERMISSIONS_REQUEST ) ; } } else { presenter . addConversation ( peoples , message ) ; input . setText ( "" ) ; } /*if (ContextCompat.checkSelfPermission(this, android.Manifest.permission.SEND_SMS)//TODO mms
                != PackageManager.PERMISSION_GRANTED) {
            //getPermissionToReadSMS(); This should be in a fragment activity
        }*/ }
checks for permissions then calls the send function in presenter
 @param view the button
checks for permissions then calls the send function in presenter @param view the button