0

How can it send a msg to someone written in the application, I have the java down below but this one asks me to write the name that I skype msg to

((Button) findViewById(R.id.skypemsg)).setOnClickListener(new OnClickListener()
  {
   @Override
   public void onClick(View v)
   {
    String skypeName = ((EditText) findViewById(R.id.edt_skypeusername)).getText().toString().trim();
    if(skypeName.length()<=0)
    {
     Toast.makeText(getApplicationContext(), "Please enter skype username to message", Toast.LENGTH_SHORT).show();
    }
    else
    {
     String mySkypeUri = "skype:"+skypeName+"?chat";
     SkypeUri(MainActivity.this, mySkypeUri);
    }
   }
  });
Tina
  • 15
  • 4
  • Sorry, I don't understand your problem. If you don't want to ask for the name, where do you want to get it from? – Axel Nov 20 '14 at 16:23
  • If I run the application; it would ask me to out a username and then it takes me to Skype to send the msg, what I want is to go to Skype where the username is already written in the code – Tina Nov 20 '14 at 16:26

1 Answers1

0

As I understand your comment, I think you want to do this (fill in the correct name):

((Button) findViewById(R.id.skypemsg)).setOnClickListener(new OnClickListener()
  {
   @Override
   public void onClick(View v)
   {
     String skypeName = "yourSkypeName"; // <-- change this
     String mySkypeUri = "skype:"+skypeName+"?chat";
     SkypeUri(MainActivity.this, mySkypeUri);
   }
  });
Axel
  • 13,939
  • 5
  • 50
  • 79