当我运行以下代码时,将拒绝访问拒绝的Win32Exception.我无法通过搜索找到任何解决方案.我该如何解决?
foreach (ListViewItem list in showprocesses.SelectedItems)
{
Process p = System.Diagnostics.Process.GetProcessById(Convert.ToInt32(list.Tag));
if (p != null)
p.Kill();
}
Run Code Online (Sandbox Code Playgroud) 我有一个RecyclerView
水平布局。各个适配器项目的高度可以取决于项目的内容。
所以理论上它可以如下所示:
我现在的问题是它wrap_content
似乎只关心第一个问题的高度,因为我得到的结果是这样的:
如您所见,第 4 项被切断。但是,如果我把最高的项目放在第一位,它就可以完美地工作。
并摆脱明显的解决方案;我不知道物品的高度。我只能在测试期间这样做。
——
适配器项.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="100dp"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:animateLayoutChanges="true"
android:padding="@dimen/padding_view_small">
<ImageView
android:id="@+id/image"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_gravity="center_horizontal"
app:srcCompat="@drawable/flamme"/>
<TextView
android:id="@+id/name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/black"
android:layout_marginTop="@dimen/padding_view_small"
android:text="@string/placeholder"
android:gravity="center_horizontal"/>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
父文件
<LinearLayout
android:id="@+id/symbol_list_parent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:background="@drawable/container_content"
android:padding="@dimen/padding_view_normal">
<android.support.v7.widget.RecyclerView
android:id="@+id/symbol_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"/>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
活动.java
...
final ProductPictogramAdapter symbolAdapter = new ProductPictogramAdapter();
final View symbolListParent = findViewById(R.id.symbol_list_parent);
RecyclerView symbolList = findViewById(R.id.symbol_list);
symbolList.setLayoutManager(new LinearLayoutManager(ProductDetailActivity.this, LinearLayoutManager.HORIZONTAL, false));
symbolList.setAdapter(symbolAdapter);
symbolList.setHasFixedSize(true);
Run Code Online (Sandbox Code Playgroud) 我一直在尝试进入驱动程序开发(排队"不要那样做")我一直在看这个msdn页面并且在安装了WDK(Windows驱动程序工具包)10后我仍然无法编译它们的示例在该页面上使用.
我查看了其他SO问题,但我无法找到WDK的已安装目录.当我尝试运行设置时,我受到了这样的欢迎:
我怎么解决这个问题?
我有一张看起来像下面的表格
@Entity
@JsonIgnoreProperties(ignoreUnknown = true)
public class Product
{
@PrimaryKey
@ColumnInfo(name = "ID")
@JsonProperty("ID")
public int id;
@ColumnInfo(name = "Name")
@JsonProperty("Name")
public String name;
@ColumnInfo(name = "Documents")
@JsonProperty("Documents")
@TypeConverters(DocumentConverter.class)
public List<Document> documents;
}
Run Code Online (Sandbox Code Playgroud)
//...
@TypeConverters(DocumentConverter.class)
@JsonIgnoreProperties( ignoreUnknown = true )
@JsonTypeName("Documents")
public class Document
{
@JsonProperty("Name")
public String name;
@JsonProperty("URL")
public String url;
}
Run Code Online (Sandbox Code Playgroud)
我可以通过执行这样的操作来根据名称检索产品
@Query("SELECT * FROM Product WHERE Name = :name")
List<Product> getProducts(String name);
Run Code Online (Sandbox Code Playgroud)
然后我就可以从每个 Product 对象访问文档列表。但是,我也想只处理具有某些文件的产品。我可以通过上面的查询获取所有产品,然后手动过滤我想要的文档,但是当我只查找非常具体的文档时会变得非常痛苦。
是否也可以基于 Document 变量进行查询而不是单独的表?
就像是...
@Query("SELECT * FROM Product WHERE Name = …
Run Code Online (Sandbox Code Playgroud)