title: Initiating a Skype Call with Button onClick
body: <p>I want to initiate a Skype call on button click. I looked up several solutions available but most of I am guessing are outdated and are not working. Could someone please help me with this? I am very new to Android Programming. I have included by code below. Any help will be appreciated.</p>
  
  <hr>
  
  <p>public class MainActivity extends AppCompatActivity {</p>
  
  <pre><code>@Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  }
  </code></pre>
  
  <p>public void CallVideo(Context myContext, String mySkypeUri){</p>
  
  <pre><code>   Uri skypeUri = Uri.parse(mySkypeUri);
     Intent myIntent = new Intent(Intent.ACTION_VIEW, skypeUri);
  
     myIntent.setComponent(new ComponentName("com.skype.raider", "com.skype.raider.Main"));
     myIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
  
     myContext.startActivity(myIntent);
  
     return;
  </code></pre>
  
  <p>}
  }</p>
  
  <hr>
  
  <p>activity_main.xml</p>
  
  <pre><code>  &lt;Button
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:text="Video Call"
      android:id="@+id/button"
      android:layout_below="@+id/textView3"
      android:layout_centerHorizontal="true"
      android:layout_marginTop="37dp"
      android:onClick="CallVideo"/&gt;
  </code></pre>