0

Hi i need to use code who change ringtone and alert tone in Android Studio.

  • Action to button1=change ringtone.
  • Action to button2=change alert tone.

Can u help me? That buttons are in ContextMenu. Context menu code:

Button contextMenuButton = (Button) findViewById(R.id.smiech);
 registerForContextMenu(contextMenuButton);
@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {
    super.onCreateContextMenu(menu, v, menuInfo);
    getMenuInflater().inflate(R.menu.menu_main,menu);
}

@Override
public boolean onContextItemSelected(MenuItem item) {
    switch (item.getItemId()){
        case R.id.item_option1:
            break;

        case R.id.item_option2:
            break;
        case R.id.item_option3:
            break;
    }

    return super.onContextItemSelected(item);
}
Jon Koops
  • 8,801
  • 6
  • 29
  • 51
  • 1) This is not JavaScript, you can remove that tag from the question. 2) I don't see anything in your code that relates to ringtones (or audio) at all. What have you actually tried? Or do you just want us to do it for you? 3) A brief Google search brings up two questions: [here](http://stackoverflow.com/q/1271777/1828486) and [here](http://stackoverflow.com/q/6182891/1828486). Will those help you at all? – Mage Xy Apr 26 '16 at 13:56
  • Hi, ty for help. I am tring to do somethink like this app:https://play.google.com/store/apps/details?id=com.morchv.stonoga I made buttons who play sound (oneClick) and when u press on the buton (longClick) is open ContextMenu, there i need to add this options(change ringtone and alert tone). Do you understand me? – Konrad Welenc Apr 26 '16 at 14:20

0 Answers0