我在白色背景上放置一个CheckBox.它在预蜂窝设备上看起来很好,但在Honeycomb上,似乎图形具有部分透明度并且是白色的,因此当未选中复选框时,您无法看到它.
我尝试使用Theme.Holo.Light如下样式:
<CheckBox android:text="" style="@android:style/Theme.Holo.Light"
android:layout_marginLeft="5dip" android:id="@+id/checkBoxWifiOnly"
android:layout_width="wrap_content" android:layout_height="wrap_content" />
Run Code Online (Sandbox Code Playgroud)
这似乎没有效果.我错误地输入了语法吗?
我正在制作一个能够上传单个或多个文件或文件夹的应用程序.intent-filter的定义如下:
<activity android:name=".UploadActivity" android:launchMode="singleTop" android:theme="@style/Theme.Sherlock">
<intent-filter android:label="@string/upload_intent">
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:mimeType="application/*" />
<data android:mimeType="audio/*" />
<data android:mimeType="image/*" />
<data android:mimeType="media/*" />
<data android:mimeType="multipart/*" />
<data android:mimeType="text/*" />
<data android:mimeType="video/*" />
</intent-filter>
<intent-filter android:label="@string/upload_intent">
<action android:name="android.intent.action.SEND_MULTIPLE" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:mimeType="*/*" />
</intent-filter>
</activity>
Run Code Online (Sandbox Code Playgroud)
这适用于Blackmoon文件资源管理器和Android 4.0.3图库.我的应用程序显示在"共享"菜单中.但是,它也会在浏览器中显示,当您长按URL并选择共享页面时.
当我将文本文件发送到我的应用程序时,我得到了这个:
getIntent().getAction() returns Intent.ACTION_SEND
getIntent().getType() returns "text/plain"
getIntent().getScheme() returns null
getIntent().getExtras().getString(Intent.EXTRA_STREAM) returns the filename
Run Code Online (Sandbox Code Playgroud)
但是,从浏览器发送URL会返回相同的内容减去 Intent.EXTRA_STREAM.我可以在代码中轻松检测到这一点并说"嘿,我无法上传文字!" 但我宁愿改变意图过滤器,以便它只在有EXTRA_STREAM时触发.有可能这样做吗?
(我尝试使用android:scheme但不会区分文件和共享的文本字符串,因为它们都是null ...)