我有一个简单的android应用程序,我正在测试以进行VOIP呼叫。在布局我有一个TextView如图使用Android提示作为默认电话或电子邮件
<org.myapp.ui.AddressText
android:id="@+id/address"
android:background="@color/colorF"
android:textColorHint="@color/colorI"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:paddingLeft="20dp"
android:paddingRight="5dp"
android:layout_toLeftOf="@id/erase"
android:layout_centerVertical="true"
android:selectAllOnFocus="false"
android:hint=" [email protected]"
android:clickable="false"
android:editable="false"
android:cursorVisible="false"
android:focusableInTouchMode="false"
android:focusable="false"
android:textIsSelectable="false"
android:visibility="visible"
android:inputType="phone" />
</RelativeLayout>
我也有一个呼叫按钮,链接到的TextView 我想,当用户按下呼叫按钮,在不改变SIP地址,应用程序应该自动拾取默认(提示)SIP地址和拨号。可能吗?
我的意图函数如下; private AddressText mAddress;
public void OutgoingCall(Intent intent) {
if (intent != null && intent.getData() != null) {
String scheme = intent.getData().getScheme();
if (scheme.startsWith("imto")) {
mAddress.setText("sip:" + intent.getData().getLastPathSegment());
} else if (scheme.startsWith("call") || scheme.startsWith("sip")) {
mAddress.setText(intent.getData().getSchemeSpecificPart());
} else {
Uri contactUri = intent.getData();
String address = "";
if(address != null) {
mAddress.setText(address);
} else {
//else statement
}
}
mAddress.clearDisplayedName();
intent.setData(null);
myPhoneManager.getInstance().newOutgoingCall(mAddress);
}
你试过'getHint()''TextView'类的API? – AADProgramming