小编Ali*_*Ali的帖子

android中的BasicAuthentication for webview无法正常工作

嗨,我想从我的android webview 打开这个网址http://3864.cloud-matic.net/,我尝试了很多方法,但应用程序甚至没有打开mainActivity.我试过的是下面的内容.

 public void onCreate(Bundle state) {
    super.onCreate(state);
    setContentView(R.layout.main);
    WebView webView = (WebView) findViewById(R.id.webView1);
    webView.setHttpAuthUsernamePassword("cloud-matic.net/",     "realm", username, password);
    webView.loadUrl("http://3864.cloud-matic.net/");
}
Run Code Online (Sandbox Code Playgroud)

请告诉我哪里错了.阿里

java android basic-authentication webview

9
推荐指数
1
解决办法
1万
查看次数

在android中的2个视图之间的碰撞

我在android中有2个视图,它们是可拖动的.我想检测它们之间的碰撞.目前我正在使用此代码来检测碰撞,但我认为它不起作用.请建议需要检查碰撞的内容.

public boolean onTouch(View view, MotionEvent event) {
    final int X = (int) event.getRawX();
    final int Y = (int) event.getRawY();
    switch (event.getAction() & MotionEvent.ACTION_MASK) {
    case MotionEvent.ACTION_DOWN:
        RelativeLayout.LayoutParams lParams = (RelativeLayout.LayoutParams) view
                .getLayoutParams();

        _xDelta = X - lParams.leftMargin;
        _yDelta = Y - lParams.topMargin;
        break;
    case MotionEvent.ACTION_UP:
        break;
    case MotionEvent.ACTION_POINTER_DOWN:
        break;
    case MotionEvent.ACTION_POINTER_UP:
        break;
    case MotionEvent.ACTION_MOVE:
        RelativeLayout.LayoutParams ParamsA = (RelativeLayout.LayoutParams) view
                .getLayoutParams();
        ParamsA.leftMargin = X - _xDelta;
        ParamsA.topMargin = Y - _yDelta;
        ParamsA.rightMargin = -250;
        ParamsA.bottomMargin = -250;

        for (int i …
Run Code Online (Sandbox Code Playgroud)

java android drag-and-drop collision-detection coordinates

4
推荐指数
1
解决办法
2372
查看次数

在不打开拨号盘的情况下拨打钛金属号码

当我使用时,我有一个简单的问题

var phone_number='12346789';

Titanium.Platform.openURL('tel:'+phone_number);

   it goes to dial pad in android i want it to directly dial the call without prompting the user to press the call button.
Run Code Online (Sandbox Code Playgroud)

我在AndroidManifest.xml中添加了权限

<uses-permission android:name="android.permission.CALL_PHONE" />
Run Code Online (Sandbox Code Playgroud)

但它还没有工作仍然要求用户按下通话按钮.任何人都有这个想法请帮助.

阿里.

android titanium appcelerator

1
推荐指数
1
解决办法
2458
查看次数