如何从sdcard将图像文件读入位图?
_path = Environment.getExternalStorageDirectory().getAbsolutePath();
System.out.println("pathhhhhhhhhhhhhhhhhhhh1111111112222222 " + _path);
_path= _path + "/" + "flower2.jpg";
System.out.println("pathhhhhhhhhhhhhhhhhhhh111111111 " + _path);
Bitmap bitmap = BitmapFactory.decodeFile(_path, options );
Run Code Online (Sandbox Code Playgroud)
我得到位图的NullPointerException.这意味着位图为空.但我有一个图像".jpg"文件存储在SD卡中作为"flower2.jpg".有什么问题?
有没有人在你的iOS应用程序中实现MVVM模式而不使用ReactiveCocoa?
在这里找到了很多例子,但他们都使用Reactive Cocoa.我想要一个MVVM实现的简单示例.
我正在尝试使用Zxing Library开发条形码扫描仪.
我的活动如下:
public class Scanner extends Activity {
private static final String PACKAGE = "com.test.scan";
private static final String SCANNER = "com.google.zxing.client.android.SCAN";
private static final String SCAN_FORMATS = "UPC_A,UPC_E,EAN_8,EAN_13,CODE_39,CODE_93,CODE_128";
private static final String SCAN_MODE = "QR_CODE_MODE";
public static final int REQUEST_CODE = 1;
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.main);
Button ok;
ok = (Button) findViewById(R.id.b1);
ok.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
Intent scanIntent = new Intent(SCANNER);
scanIntent.setPackage(PACKAGE);
scanIntent.addCategory(Intent.CATEGORY_DEFAULT);
scanIntent.putExtra("SCAN_FORMATS", SCAN_FORMATS);
scanIntent.putExtra("SCAN_MODE", SCAN_MODE);
try {
startActivityForResult(scanIntent, …Run Code Online (Sandbox Code Playgroud)
我无法将电子邮件客户端中的TO字段预先填写到此处附加内容中提到的"到"地址:
EmailImage.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
Intent it = new Intent(Intent.ACTION_SEND_MULTIPLE);
it.putExtra(Intent.EXTRA_EMAIL, "toaddress@gmail.com");
it.putExtra(Intent.EXTRA_SUBJECT, "Regarding Policy Info");
it.putExtra(Intent.EXTRA_TEXT, "When is my next Premium due");
//it.setType("text/plain");
it.setType("message/rfc822");
startActivity(it);
}
});
Run Code Online (Sandbox Code Playgroud)
问题是什么?
谢谢
Sneha
是否有可能使用Apple的WatchKit开发第三方应用程序,其中包含用于心跳/速率数据访问/原始数据访问的API?
WatchKit SDK现在是否可供开发人员公开使用?
我想知道是否有任何方法可以从本机Android Activity调用JavaScript函数.
我碰到:
webView.loadUrl("javascript:hello()");
Run Code Online (Sandbox Code Playgroud)
但它对我不起作用.
此外,Android将如何知道此JavaScript函数驻留在哪个html页面中?
当我尝试运行npm install时出现以下错误.错误如下:
npm ERR! node v0.12.12
npm ERR! npm v3.3.6
npm ERR! code ELIFECYCLE
npm ERR! angular2-quickstart@1.0.0 postinstall: `typings install`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the angular2-quickstart@1.0.0 postinstall script 'typings ins
tall'.
npm ERR! This is most likely a problem with the angular2-quickstart package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! typings install
npm ERR! You can get their info via:
npm …Run Code Online (Sandbox Code Playgroud)我必须比较两个日期,其中第一个日期是日历格式,其他日期是字符串(DD-MMM-yyyy)格式.所以我想将其中一个Calendar日期转换为String并使用compareTo方法.
我尝试过使用:
SimpleDateFormat formatter=new SimpleDateFormat("DD-MMM-yyyy");
String currentDate=formatter.format(view.getSelectedDay());
Run Code Online (Sandbox Code Playgroud) 我使用bootstrap3作为RWD并定制了我的面包屑.但是,它不适合移动尺寸.
我怎样才能使其响应?
附上问题的截图.
谢谢 
我尝试npm install时出现以下错误:
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs
\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v0.10.36
npm ERR! npm v2.12.1
npm ERR! Cannot read property 'latest' of undefined
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs
\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v0.10.36
npm ERR! npm v2.12.1
npm ERR! Cannot read property 'latest' of undefined
npm ERR!
npm …Run Code Online (Sandbox Code Playgroud) android ×5
node.js ×2
angular ×1
apple-watch ×1
architecture ×1
breadcrumbs ×1
calendar ×1
date ×1
email ×1
exitstatus ×1
extra ×1
ios ×1
iphone ×1
java ×1
javascript ×1
mvvm ×1
npm ×1
watchkit ×1
xcode5 ×1
zxing ×1