Back to project page C2Framework.
The source code is released under:
Apache License
If you think the Android project C2Framework listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package gaia.c2.content.android.model; // w w w . j a va2s .c om import android.content.Intent; import android.net.Uri; import android.os.Parcel; import android.os.Parcelable; import gaia.c2.content.model.ContextDependentModel; import gaia.c2.context.C2Context; /** * Created by kmr on 4/13/14. */ public class Dial implements ContextDependentModel, Parcelable { public static final String MIME_TYPE = "x-android/dial"; private C2Context ctx; private String telephone; public Dial(String tl) { this.telephone = tl; } @Override public Dial using(C2Context ctx) { this.ctx = ctx; return this; } public void dial() { Intent callIntent = new Intent(Intent.ACTION_DIAL); callIntent.setData(Uri.parse("tel:" + this.telephone)); this.ctx.startActivity(callIntent); } //region parcelable public Dial(Parcel in) { telephone = in.readString(); } @Override public int describeContents() { return this.hashCode(); } @Override public void writeToParcel(Parcel parcel, int i) { parcel.writeString(telephone); } public static final Creator CREATOR = new Creator() { public Dial createFromParcel(Parcel in) { return new Dial(in); } public Dial[] newArray(int size) { return new Dial[size]; } }; //endregion }