0

I am trying to set a toggle button that will enable and disable notification for the app i am building. The current code i have it set up for an old password field as I was using thenewboston Android Tutorial. This is My Current Code:

package com.example.smartfood;

import android.app.Activity;
import android.os.Bundle;
import android.text.InputType;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.ToggleButton;

public class Settings extends Activity {

Button chkCmd;
ToggleButton notTog;
EditText input;
TextView display;
@Override
protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    setContentView(R.layout.text);      
    notTog = (ToggleButton) findViewById(R.id.tbResult);
    display = (TextView) findViewById(R.id.tbResult);
    notTog.setOnClickListener(new View.OnClickListener() {

        public void onClick(View v) {
            // TODO Auto-generated method stub
            if (notTog.isChecked()){
                input.setInputType(InputType.TYPE_CLASS_TEXT  | InputType.TYPE_TEXT_VARIATION_PASSWORD);
            }else{
                input.setInputType(InputType.TYPE_CLASS_TEXT);
            }
        }
    });
}

}

any help would be greatly appreciated

Conor Das
  • 9
  • 5
  • And what exactly is your question? You've shown us some code and told us what you want to do, but you haven't asked any question. – David Wasser Oct 23 '14 at 21:04
  • I am unsure what code I need, I was looking for some sort of advice on what to use, I'm a new android developer and am unsure how to enable this function – Conor Das Oct 23 '14 at 21:35

0 Answers0