小编And*_*rry的帖子

你如何在adb shell的URL中加入&符号?

运用

$ adb shell am start some://url
Run Code Online (Sandbox Code Playgroud)

我可以使用活动管理器启动URL.但是,如果我包含多个URL参数,则除了第一个参数之外的所有参数都会被删除.

例:

$ adb shell am start http://www.example.com?param1=1&param2=2
Run Code Online (Sandbox Code Playgroud)

返回:

$ Starting: Intent { act=android.intent.action.VIEW dat=http://www.example.com?param1=1 }
Run Code Online (Sandbox Code Playgroud)

并且在&符号被忽略之后,param2就会消失.我想知道是否有一些编码/转义字符,以防止这种情况.

android adb

30
推荐指数
3
解决办法
8451
查看次数

如何在Dev环境中测试Smart App Banner Urls

我想知道是否可以在iOS应用程序的开发版本上测试iOS 6的智能应用横幅的app-argument URL参数.只有从App Store下载应用程序时,才会显示横幅中的"打开"选项.

meta-tags ios ios6

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

如何处理android中弹出窗口内按钮的onclick事件

在我的应用程序中,我最初在屏幕上有一个按钮,在onclick按钮中,应该打开一个弹出窗口.在弹出窗口中,我有一个图像onclick按钮,而这个按钮,我想开始一个活动.弹出窗口打开,但我不明白如何处理onclick弹出窗口中的图像按钮.

在main.xml中,我有一个按钮,在popup_example.xml中,我有一个图像按钮.

我的Java代码如下:

final LayoutInflater inflater = (LayoutInflater)this.getSystemService(Context.LAYOUT_INFLATER_SERVICE); 
final Button b=(Button)findViewById(R.id.btn);
b.setOnClickListener(new OnClickListener()
{
    public void onClick(View v)
    {
        PopupWindow pw = new PopupWindow(inflater.inflate(R.layout.popup_example,(ViewGroup)findViewById(R.layout.main)));
        pw.showAtLocation(v, Gravity.LEFT,0,0);
        pw.update(8,-70,150,270);

        //if onclick written here, it gives null pointer exception.
        ImageButton img=(ImageButton)findViewById(R.id.home);
        img.setOnClickListener(new OnClickListener()
        {
            public void onClick(View v)
            {
                Intent.....
            }
        });

        //if onclick is written here it gives runtime exception.
    }); 
Run Code Online (Sandbox Code Playgroud)

我有两个xml布局.........

  1. main.xml中

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
        android:orientation="vertical" 
        android:layout_width="fill_parent" 
        android:layout_height="wrap_content"> 
    
        <ImageButton 
            android:id="@+id/btn"
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content"
            android:src="@drawable/ghj" …
    Run Code Online (Sandbox Code Playgroud)

android

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

服务上的OnBind()总是返回False - Android

我正在尝试绑定服务,但onBind()总是返回false.

这是 - 的代码ServiceConnection-

private ServiceConnection mConnection = new ServiceConnection() {
    public void onServiceConnected(ComponentName className, IBinder service) {
        // This is called when the connection with our service has been established, 
        // giving us the service object we can use to interact with our service.
        mBoundService = ((ScheduleService.ServiceBinder) service).getService();
    }

    public void onServiceDisconnected(ComponentName className) {
        mBoundService = null;
    }
};
Run Code Online (Sandbox Code Playgroud)

这是对bindService()-

boolean test = getApplicationContext().bindService(new Intent(this, ScheduleService.class), mConnection, Context.BIND_AUTO_CREATE);
Run Code Online (Sandbox Code Playgroud)

这是清单中服务的声明 -

<service android:name=".Notifications.ScheduleService" android:enabled="true"/> …
Run Code Online (Sandbox Code Playgroud)

service notifications android android-service android-context

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