我有两个应用程序:app1和app2.
App2有:
<provider
android:name="android.support.v4.content.FileProvider"
android:authorities="com.android.provider.ImageSharing"
android:exported="false"
android:grantUriPermissions="true" >
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/paths" />
</provider>
Run Code Online (Sandbox Code Playgroud)
paths.xml:
<paths>
<files-path name="my_images" path="images/"/>
</paths>
Run Code Online (Sandbox Code Playgroud)
App2从App1的Activity中接收请求以获取图像的URI.确定URI后,App2活动执行以下操作:
Intent intent = new Intent();
intent.setDataAndType(contentUri, getContentResolver().getType(contentUri));
int uid = Binder.getCallingUid();
String callingPackage = getPackageManager().getNameForUid(uid);
getApplicationContext().grantUriPermission(callingPackage, contentUri,
Intent.FLAG_GRANT_READ_URI_PERMISSION);
setResult(Activity.RESULT_OK, intent);
finish();
Run Code Online (Sandbox Code Playgroud)
从App2收到结果后,App1执行以下操作:
Uri imageUri = data.getData();
if(imageUri != null) {
ImageView iv = (ImageView) layoutView.findViewById(R.id.imageReceived);
iv.setImageURI(imageUri);
}
Run Code Online (Sandbox Code Playgroud)
在App1中,从App2返回时,我得到以下异常:
java.lang.SecurityException:Permission Denial:从ProcessRecord {52a99eb0 3493:com.android.App1.app/u0a57}(pid = 3493,uid = 10057)打开提供者android.support.v4.content.FileProvider uid 10058
我究竟做错了什么 ?
如何显示具有全名和活动状态的正在运行的进程列表?
我试过这个命令: pgrep -lf python
有谁知道甚至可以在WPF Wrap面板中输入换行符?它违背了包装面板的用途,所以我不确定它是否可行.
如果不是,是否有任何其他WPF控件实际上允许我输入换行符并支持添加childern(我自己的自定义控件?)
精简版:
目标: C#中无边界WinForm中的深色,黑暗,Windows 7阴影
已知的现有解决方案1:使用CreateParams的简单XP风格的阴影.
问题:太弱,太轻,太难看.
已知的现有解决方案2:用位图替换形式的GDI.
问题:失去使用控件的功能,仅作为启动画面使用.
这篇文章的目标:找到这个问题的中位数解决方案,或者更好地解决这个问题.
...
长版:
(编辑:我指的是沿着任何窗体边界的阴影,如果不清楚的话.)我知道有一种方法可以在C#中使用以下方法制作XP风格的阴影:
C#Code 1 - 简单的XP风格的阴影(问题:点亮,变弱,变丑)
// Define the CS_DROPSHADOW constant
private const int CS_DROPSHADOW = 0x00020000;
// Override the CreateParams property
protected override CreateParams CreateParams
{
get
{
CreateParams cp = base.CreateParams;
cp.ClassStyle |= CS_DROPSHADOW;
return cp;
}
}
Run Code Online (Sandbox Code Playgroud)
但是,我试图弄清楚如何使它们看起来像Windows 7中的做(更深和更大的阴影),并且无法找出最佳方法.
我有一个现在创建的方法,让我覆盖整个表格GDI,看起来像一个启动画面(信不信任):
C#代码2:用位图替换表单GDI(问题:不能使用表单控件,难以维护GUI)
public void SetBitmap(Bitmap bitmap, byte opacity)
{
if (bitmap.PixelFormat != PixelFormat.Format32bppArgb)
throw new ApplicationException("The bitmap must be 32ppp with alpha-channel.");
// …Run Code Online (Sandbox Code Playgroud) 我已经看到了这些答案,所以请不要在解决方案中链接em:
在Ubuntu 16.04安装MongoDB的 https://unix.stackexchange.com/questions/220467/mongodb-unmet-dependencies/220483 不能安装在Ubuntu 16.10的MongoDB https://www.digitalocean.com/community/tutorials/how-安装的-的MongoDB上,Ubuntu的16-04
我已经为ubuntu 16.04添加了所需的存储库
当我运行时sudo apt-get install -y mongodb-org,它会抛出错误:
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
linux-headers-4.4.0-93-generic : Depends: linux-headers-4.4.0-93 but it is not going to be installed
mongodb-org : Depends: mongodb-org-shell but it is not going to be installed
Depends: mongodb-org-server but it is not going to be installed
Depends: mongodb-org-mongos …Run Code Online (Sandbox Code Playgroud) 我有一个具有初始值的文本框(多行),现在当用户尝试向其附加值时,他应该无法修改初始值。有可能吗?
任何人都知道为什么ChartArea.BackImage是string类型的属性?对于这种类型的Image属性来说,它是否更有意义?
或者换句话说,如何将ChartArea的背景图像设置为在运行时生成的图像(例如,从GraphicPath对象)?
欢迎提出建议,谢谢.
我有一项从其他应用程序获取数据的服务。
当我得到日期时,我发送消息broadCast以刷新用户界面。
该onReceive方法被多次调用,数据被多次显示。
这是我的代码:
数据服务.java
if(sizeLat == 1) {
sendMessage("Alerte1;");
}
else {
sendMessage("Alerte2;");
}
private void sendMessage(String message) {
Log.w("","==> send message");
Intent intent = new Intent("my-event");
// add data
intent.putExtra("message", message);
LocalBroadcastManager.getInstance(this).sendBroadcast(intent);
}
Run Code Online (Sandbox Code Playgroud)
MainActivity.java
// handler for received Intents for the "my-event" event
private BroadcastReceiver mMessageReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
Log.e("","Onreceiver");
String message = intent.getStringExtra("message");
if(message.equals("Alerte1")){
parentItems.add(message);
adapter.notifyDataSetChanged();
}}};
@Override
protected void onResume() {
Log.d(TAG, "On …Run Code Online (Sandbox Code Playgroud) 我能够在CSS中创建一个普通的方形div和一个三角形div.但我不知道如何用一个div制作这样的形状.谁能帮我吗 ?
此外,我希望它扩展到它的父级的整个宽度,但 border属性不支持百分比.(例如border-left: 160px solid transparent;)
.container{
width: 100%;
position: relative;
}
.v-div {
width: 0;
height: 0;
border-left: 160px solid transparent;
border-right: 160px solid transparent;
border-top: 100px solid #f00;
}
.box{
height: 80px;
width: 320px;
background: red;
}Run Code Online (Sandbox Code Playgroud)
<div class="container">
<div class="box">
</div>
<div class="v-div">
</div>
</div>Run Code Online (Sandbox Code Playgroud)