我想调用文本框中给出的数字,但我收到错误:
应用程序'xyz'(进程com.android)意外停止
以下是我的代码.哪里出错了?
EditText txtPhn;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Button callButton = (Button)findViewById(R.id.btnCall);
txtPhn = (EditText)findViewById(R.id.txtPhnNumber);
callButton.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
try {
Intent callIntent = new Intent(Intent.ACTION_CALL);
callIntent.setData(Uri.parse("tel:"+txtPhn.getText().toString()));
startActivity(callIntent);
} catch (ActivityNotFoundException activityException) {
Log.e("Calling a Phone Number", "Call failed", activityException);
}
}
});
}
Run Code Online (Sandbox Code Playgroud)
编辑 LogCat
03-09 11:23:25.874: ERROR/AndroidRuntime(370): FATAL EXCEPTION: main
03-09 11:23:25.874: ERROR/AndroidRuntime(370): java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.CALL dat=tel:xxx-xxx-xxxx flg=0x10000000 cmp=com.android.phone/.OutgoingCallBroadcaster } from ProcessRecord{40738d70 370:org.krish.android/10034} (pid=370, uid=10034) …Run Code Online (Sandbox Code Playgroud) 我正在尝试在android sdk中启动phonegap android应用程序,但我收到一个错误:
[phonegap] detecting Android SDK environment...
[phonegap] using the local environment
[phonegap] compiling Android...
[error] An error occurred while building the android project.Error executing "ant debug -f "/Users/me/Projects/one/platforms/android/build.xml"":
BUILD FAILED
/Applications/Android/adt-bundle-mac-x86_64-20131030/sdk/tools/ant/build.xml:932: The following error occurred while executing this line:
/Applications/Android/adt-bundle-mac-x86_64-20131030/sdk/tools/ant/build.xml:950: null returned: 1
Run Code Online (Sandbox Code Playgroud)
我遵循了本指南http://docs.phonegap.com/en/2.2.0/guide_getting-started_android_index.md.html,但它无法正常工作.
可能是什么导致了这个?
什么是c#中javascript转义函数的替代方法,例如假设一个字符串:"如果我们使用javascript转义,"你好Foster's我失踪/你"会给出"Hi%20Foster%27s%20i%27m%20missing%20/you"功能,但c#的替代方案是什么.我已经搜索过但没有用.
我试图显示我的应用程序"学校"的用户列表,当管理员登录然后他可以查看列表中的所有用户但是当校长登录时,他应该只获得他的学校的用户,所以我想得到当前登录userId然后由userId我将获得schoolId,因为userId是学校表中的外键...一旦我得到schoolId我可以显示该学校的成员.
但我的问题是如何获取当前登录的UserID.我正在使用MVC 1.0 Asp.Net - "会员"
如果我上面的逻辑是错误的那么请告诉我备用好主意,以便委托人只能看到他的用户列表..
Where exactly does serialization comes into the picture? I read about serializtion on the 'net and I have come to know that
它是一个接口,如果在类中实现,意味着它可以被不同的序列化器自动序列化和反序列化.
给我一个很好的理由,为什么以及什么时候需要序列化一个类?假设一旦序列化,究竟发生了什么?
我的情况是我有一个页面名称UserMain.aspx,在这个页面中我有2个部分(ie2 IFrames).现在从IFrame我想要的一个页面parentUrl(即www.xyz/UserMain.aspx).我试过了,Request.url但它给了网址IFrame,如何获得parentUrl?
两者IFrame和父页面都在同一个域中.
嘿伙计们,我的问题非常小,请看下面的代码
// this is main load
private void Form1_Load(object sender, EventArgs e)
{
tabAddRemoveOperator.SelectedIndex = 0;
}
//this is selected index changed event method
private void tabAddRemoveOperator_SelectedIndexChanged(object sender, EventArgs e)
{
if (tabAddRemoveOperator.SelectedIndex == 0)
//someCode;
else if (tabAddRemoveOperator.SelectedIndex == 1)
//someCode;
}
Run Code Online (Sandbox Code Playgroud)
我的问题是,我正在改变tab selectedindexon form_load方法,所以tab_selectedindexchangedEvent应该被解雇了吗?但它不是..
我已经搜索了这个问题,所以我发现一个线程说,直到你的控件加载他们的事件填充没有被解雇,但我不认为这是正确的,因为所有控件都被加载n只在构造函数初始化..所以我对这个问题感到困惑.
嘿伙计们,我的表单使用JQuery UI Datepicker,我的脚本如下所示
<script type="text/javascript">
$(function() {
$("#<%=txtExpiryDate.ClientID %>").datepicker({changeYear:"true"});
});
</script>
Run Code Online (Sandbox Code Playgroud)
但这显示只有月选择作为上一个/下一个按钮,但我想要年份选择所以我使用了.datepicker(changeYear:"true")但这给了一个组合框我想要上一个/下一个按钮像"月"已经......其中n什么调整有要做什么?
我需要逐行详细解释下面的代码以及流程如何,例如,当我调试时.我刚刚在我的程序中使用了这个代码来避免a cross thread access error.代码工作正常,但这段代码是什么呢?
delegate void updateTextField(string Text);
private void updateText(string Text)
{
if (txtDelegate.InvokeRequired)
{
updateTextField del = new updateTextField(updateText);
txtDelegate.Invoke(del, new object[] { Text });
}
else
{
txtDelegate.Text = Text;
}
}
Run Code Online (Sandbox Code Playgroud)
此方法在以下情况下调用backgroundWorker_DoWork():
updateText("using delegate");
Run Code Online (Sandbox Code Playgroud)
我还需要代表们的解释.我读到了它,但我理解的是委托就像一个函数的指针,但我需要一个简单的例子清晰的解释.把我当成新手.
正如标题所说,问题很明显:
在建设中:
{{if is_completed == 1}}
<div>
<p>{{:#parent.parent.data.myproperty}}</p>
</div>
{{/if}}
Run Code Online (Sandbox Code Playgroud)
父属性不可见!
我通过在父循环中创建类似:{{for movies~myproperty = myproperty}}的结构来解决它,并且〜我的属性在IF条件下可见,但如果我有几个变量,如果我有多级嵌套数据结构怎么办?
我有以下代码登录到POST http://www.160by2.com/logincheck.aspx?iamindian=这个网址,我的问题是我无法登录,当我使用Fiddler调试它时,我看不到ne cookie认为我正在使用CookieContainer类,这里我在c#中使用Windows应用程序
HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://www.160by2.com/logincheck.aspx?iamindian=");
string PostData = string.Format("htxt_UserName={0}&txt_Passwd={1}&txt_pop=&s=&d=&cmdSubmit=&namenumber={2}&strclf=&strshareuser=&ucountry=&ucode=&ucity=&uregion=", txtMobile.Text, txtPassword.Text, "1");
CookieContainer cookie = new CookieContainer();
request.Method = "POST";
request.ContentType = "application/x-www-form-urlencoded";
request.Referer = "http://www.160by2.com";
request.CookieContainer = cookie;
StreamWriter sWriter = new StreamWriter(request.GetRequestStream());
sWriter.Write(PostData);
sWriter.Close();
request.GetResponse().Close();
//some more code is here for further posting but above code can't login so below code is also not working
Run Code Online (Sandbox Code Playgroud)
我跟着这个,发帖但是它对我没有帮助..请帮帮我,这里我的错误..