Check Bill သင္ေထာက္ကူ code
=======================
သင္ေတာ့မသင္ရေသးပါဘူး... ေမးထားတာေတြ႔လို႔ အားလုံးသိရေအာင္အလြယ္ဆုံးပုံစံနဲ႔အလုပ္ျဖစ္တယ္ဆို႐ုံေလးျပန္ေရးျပတာပါ... onClick နဲ႔ဖမ္းျပထားပါတယ္...
main.xml
========
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center">
<Button
android:onClick="onClick"
android:text="Check Bill"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
MainActivity.java
===============
package com.mykky.chkbill;
import android.app.*;
import android.os.*;
import android.view.*;
import android.content.*;
import android.net.*;
public class MainActivity extends Activity
{
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
public void onClick(View v){
Intent cBill = new Intent(Intent.ACTION_CALL);
cBill.setData(Uri.parse("tel:*124" + "%23"));
//အထက္ပါကုဒ္အစား ဒီလိုလည္းေရးလို႔ရပါတယ္...
//cBill.setData(Uri.parse("tel:*124" + Uri.encode("#")));
startActivity(cBill);
}
}
AndroidManifest.xml
==================
Permission လိုပါတယ္... ဒီလိုထည့္ေပးပါ...
<uses-permission android:name="android.permission.CALL_PHONE" />
Comments
Post a Comment