如何将uri图像的路径发送到另一个活动并将其转换为图像.我试过以下
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == 1 && resultCode == RESULT_OK && data != null && data.getData() != null) {
//file name
Uri selectedImage = data.getData();
Intent i = new Intent(this,
AddImage.class);
i.putExtra("imagePath", selectedImage);
startActivity(i);
Run Code Online (Sandbox Code Playgroud)
并得到这样的
String imagePath = getIntent().getStringExtra("imagePath");
imageview.setImageURI(Uri.parse(imagePath ));
Run Code Online (Sandbox Code Playgroud) 我正在关注 RecyclerView 示例,但出现此错误
incompatible types: cannot cast viewholder to imageviewholder
Run Code Online (Sandbox Code Playgroud)
在这个代码上
case TYPE_IMAGE:
ImageViewHolder imageViewHolder = (ImageViewHolder) holder;
Run Code Online (Sandbox Code Playgroud)
这是我的完整代码(已编辑)
public class MyAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
private ArrayList<String> mDataset;
public class ImageViewHolder extends RecyclerView.ViewHolder {
//ImageView mImage;
public TextView txtHeader;
public TextView txtFooter;
public ImageViewHolder(View itemView) {
super (itemView);
txtHeader = (TextView) itemView.findViewById(R.id.firstLine1);
txtFooter = (TextView) itemView.findViewById(R.id.secondLine1);
}
}
// Provide a reference to the views for each data item
// Complex data items may need more than one view per …Run Code Online (Sandbox Code Playgroud) 我正在搜索一个查询,该查询告诉我表示例的主键的名称
:在oracle中,我这样做
从user_constraints中选择CONSTRAINT_NAME,其中table_name ='CT'AND CONSTRAINT_TYPE ='P'
如何在sybase中做到这一点?
我想删除一个索引:
DROP INDEX PK_CHARGES
Run Code Online (Sandbox Code Playgroud)
但是我得到了这个错误
不能删除用于执行唯一/主键的索引
为什么我收到此错误?如果您需要,我会提供进一步的信息.
怎么解决?
编辑我在表中没有主键,但我发现这个奇怪的索引,我不记得我添加了:
索引名称= SYS_C0040476,它们具有相同的列
我正在尝试创建一个文件夹并将图像保存在其中.
但它不起作用.
我不知道我的代码有什么问题 - 你能告诉我为什么吗?
// The method that invoke of uploading images
public void openGallery() {
Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent, "Select Picture"), 1);
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == 1 && resultCode == RESULT_OK && data != null && data.getData() != null) {
File folder = new File(this.getExternalFilesDir(
Environment.DIRECTORY_PICTURES), "albumName");
File file = new File(this.getExternalFilesDir(
Environment.DIRECTORY_PICTURES), "fileName"+3);
Bitmap imageToSave = (Bitmap) data.getExtras().get("data");
try { …Run Code Online (Sandbox Code Playgroud) 当我在SQL开发人员中使用select*语句时,返回的列的顺序不是表中定义的顺序.如果我在连接窗格中查看表本身,则在列选项卡下,列的顺序正确并且分配了正确的列ID.当其他人使用不同的PC在表上运行查询时,列将以正确的顺序显示.这让我相信这是我的SQL开发人员的一个设置.如果我是对的,我怎么能改变这个.
EX.列按照列选项卡中的列ID按此顺序排列.当从任何其他PC在此表上执行select*时,显示从左到右的顺序:
1. MESSAGE_ID
2. SOURCE_ID
3. EVENT_ID
4. WHEN_CREATED
5. CONTAINER_ID
6. CONTAINER_TYPE
7. WAVE_NUMBER
8. LOCATION
9. DEST_LOCATION
10. ITEM_NAME
11. BATCH_NUMBER
12. BARCODE
13. CONTAINER_QUANTITY
14. CUBE_VOLUME
15. ORDER_ID
16. PICK_STATUS
17. PICK_PUT_LOCATION
18. ITEM_QUANTITY
19. PICKED_QUANTITY
20. REQUIRED_QUANTITY
21. MOD_DATE
22. USER_ID
Run Code Online (Sandbox Code Playgroud)
但是,当我在我的电脑上的sql developer中从这个表中选择*时,这是它们从左到右显示的顺序:
1. WAVE_NUMBER
2. LOCATION
3. ITEM_NAME
4. BATCH_NUMBER
5. BARCODE
6. CONTAINER_ID
7. CONTAINER_QUANTITY
8. CUBE_VOLUME
9. ORDER_ID
10. PICK_STATUS
11. PICK_PUT_LOCATION
12. ITEM_QUANTITY
13. PICKED_QUANTITY
14. REQUIRED_QUANTITY
15. MOD_DATE
16. USER_ID …Run Code Online (Sandbox Code Playgroud) 我有这些Strings:
"Turtle123456_fly.me"
"birdy_12345678_prd.tr"
Run Code Online (Sandbox Code Playgroud)
我想要每个词的第一个词,即:
Turtle
birdy
Run Code Online (Sandbox Code Playgroud)
我试过这个:
Pattern p = Pattern.compile("//d");
String[] items = p.split(String);
Run Code Online (Sandbox Code Playgroud)
但这当然是错误的。我不熟悉使用Pattern.
我收到此错误
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.e.www.i/com.e.www.i.Search}: java.lang.InstantiationException: class com.e.www.i.Search has no zero argument constructor
Run Code Online (Sandbox Code Playgroud)
这是下面的类:
public class Search extends Activity {
private RecyclerView mRecyclerView;
private RecyclerView.Adapter mAdapter;
private RecyclerView mRecyclerView1;
private RecyclerView.Adapter mAdapter1;
Context mContext;
public Search(Context context) {
mContext = context; // I guess the error is here, but I need to define context for below MyAdapter
}
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_recycler_view);
mRecyclerView = (RecyclerView) findViewById(R.id.my_recycler_view);
mRecyclerView.setHasFixedSize(true);
mRecyclerView.setLayoutManager(
new LinearLayoutManager(this,LinearLayoutManager.HORIZONTAL, false));
mAdapter = new MyAdapter(getDataSet(),mContext); …Run Code Online (Sandbox Code Playgroud) 我想念什么?我跟踪了这些答案error-inflating-class-android,support-design-widget-navigationview。但还是开始这个错误
Error inflating class android.support.design.widget.BottomNavigationView
Didn't find class "android.support.design.widget.BottomNavigationView" on path: DexPathList[[zip file ...
Run Code Online (Sandbox Code Playgroud)
我的MainActivity包括AppCompatActivity:
public class MainActivity extends AppCompatActivity implements NavigationView.OnNavigationItemSelectedListener {
Run Code Online (Sandbox Code Playgroud)
我的成绩是:
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.squareup.okhttp:okhttp:2.5.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.android.support:recyclerview-v7:23.0.+'
Run Code Online (Sandbox Code Playgroud)
我的风格是:
<!-- Base application theme. -->
<style name="AppTheme" parent="Base.AppTheme">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
<style name="Base.AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="android:colorPrimary">@color/colorPrimary</item>
<item name="android:colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="android:colorAccent">@color/colorAccent</item>
</style>
<style name="AppTheme.NoActionBar">
<item …Run Code Online (Sandbox Code Playgroud) android ×6
java ×2
oracle ×2
oracle11g ×1
primary-key ×1
regex ×1
sql ×1
sqlplus ×1
sybase ×1
sybase-ase ×1
unique-index ×1
xml ×1