我希望我的代码在保存之前调整图像大小,但我在Google上找不到任何关于它的信息.请问你能帮帮我吗 ?
这是代码(来自Android doc):
private void galleryAddPic() {
Intent mediaScanIntent = new Intent("android.intent.action.MEDIA_SCANNER_SCAN_FILE");
File f = new File(mCurrentPhotoPath);
picturePathForUpload = mCurrentPhotoPath;
Uri contentUri = Uri.fromFile(f);
mediaScanIntent.setData(contentUri);
this.sendBroadcast(mediaScanIntent);
}
Run Code Online (Sandbox Code Playgroud)
之后,我必须将其上传到服务器.
非常感谢.
所以,我必须开发一个移动应用程序,我想使用Phonegap或Titanium,但我需要有关这些技术的建议......
他们是免费的吗?它们的局限是什么?
我不太了解它们,我想在开始编码之前获得更多信息......
谢谢!
我的Android应用程序有一个小问题.我搜索了很长时间,但没有发现我的问题.
场景:我要显示一个还原列表视图(如Facebook Messenger).当用户滚动到顶部时,加载更多消息.
问题:notifiyDataAsChanged()
通话结束后,滚动不一样!我想保存与装载前完全相同的位置.
我试过那段代码:
// save index and top position
int index = list.getFirstVisiblePosition()+result.size();
View v = list.getChildAt(index);
int top = (v == null) ? 0 : v.getTop();
// ...
// restore
list.setSelectionFromTop(index, top);
Run Code Online (Sandbox Code Playgroud)
但加载后滚动不完全相同.
你有个主意吗?
我想在列表视图中加载数据后从服务器加载图像.我知道这个问题存在很多主题,但我还没有找到解决方案......
所以这是我的代码:
//asyncTackClass for loadingpictures
public class LoadImagesThread extends AsyncTask<Bundle, Void, Bitmap> {
private ImageView view;
private Bitmap bm;
private Context context;
private final WeakReference<ImageView> imageViewReference;
private final String BUNDLE_URL = "url";
private final String BUNDLE_NAME = "name";
private final String BUNDLE_BM = "bm";
public LoadImagesThread(Context context, ImageView view) {
this.context=context;
imageViewReference = new WeakReference<ImageView>(view);
}
@Override
protected Bitmap doInBackground(Bundle... b) {
Bitmap bm =null;
if (StorageHelper.getBitmap(b[0].getString(BUNDLE_NAME)) != null) { // Check the sdcard
bm = StorageHelper.getBitmap(b[0].getString(BUNDLE_NAME));
Log.w("LoadImagesThread", "Get image …
Run Code Online (Sandbox Code Playgroud) 请原谅我的英语不好,我是法国人!
我有一个关于我的Android应用程序的问题...我想整合一个谷歌地图,所以我已经按照教程(来自谷歌开发者网站),但当我何时尝试谷歌演示我有一个空白地图!什么都没有显示,我有这个错误:
06-17 14:34:29.067: E/Google Maps Android API(29152): Authorization failure. Please see https://developers.google.com/maps/documentation/android/start for how to correctly set up the map.
06-17 14:34:29.067: E/Google Maps Android API(29152): Ensure that the following correspond to what is in the API Console: Package Name: com.example.mapdemo, API Key: AIzaSyBWkgi7WlIhPRT8UQtxyIlz4yr9UZ3qE5c, Certificate Fingerprint: ADFDA5FBEEFC1C02BEFD197CD30B3A581327107D
06-17 14:34:29.887: E/Google Maps Android API(29152): Failed to load map. Error contacting Google servers. This is probably an authentication issue (but could be due to network errors).
Run Code Online (Sandbox Code Playgroud)
我已经执行了这个命令以获得SHA-1:
C:\Program Files\Java\jdk1.7.0_21\bin>keytool -list -alias …
Run Code Online (Sandbox Code Playgroud) 我正在使用Fastlane
我的管理员帐户(Mac OS),它运行得很好。
我现在尝试安装和配置Jenkins
+Fastlane
但是当 jenkins 尝试运行 fastlane 命令时,我收到该错误:can't find gem fastlane (>= 0.a) with executable fastlane (Gem::GemNotFoundException)
我的 fastlane 安装路径是:/Users/myusername/.rvm/rubies/ruby-2.4.2/bin
当我尝试更新 jenkins 帐户 (su jenkins) 中的 fastlane 时,控制台说我不是 sudo。我的帐户没有错误。
已经尝试在 jenkins conf 中注入 Path 并设置 RVM 管理的环境版本。但它失败了。
我有一个问题......在Eclipse上,当我想从互联网上加载一个Android库时,我在@Override注释上遇到了很多错误.
我正在使用JDK 1.7 ...
谢谢你的帮助 !
我必须使用片段,支持v4,但是我的应用程序崩溃了.我找不到解决方案!
这是我的代码:
activity_advert_list.xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" >
<android.support.v4.app.Fragment
android:id="@+id/advertListFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:name="com.myapp.fragment.AdvertListFragment"/>
Run Code Online (Sandbox Code Playgroud)
AdvertListActivity.java
package com.myapp.app;
import java.util.ArrayList;
import com.myapp.R;
import com.myapp.classmodel.Advert;
import com.myapp.fragment.AdvertDetailFragment;
import com.myapp.interf.OnAdvertSelectedListener;
import com.google.analytics.tracking.android.EasyTracker;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
public class AdvertListActivity extends FragmentActivity implements OnAdvertSelectedListener {
private AdvertListActivity activity = this;
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_advert_list);
}
@Override
public void onStart() {
super.onStart();
// Google Analytics
EasyTracker.getInstance().activityStart(this);
}
@Override
public void onStop() {
super.onStop();
// Google Analytics
EasyTracker.getInstance().activityStop(this);
}
/** …
Run Code Online (Sandbox Code Playgroud) 我想替换Fragment
使用FragmentTransaction
.它工作正常但在重新安置期间,Android在显示新内容之前显示一个非常难看的空白屏幕Fragment
代码是:
FragmentManager mng = getSupportFragmentManager();
FragmentTransaction transac = mng.beginTransaction();
transac.replace(R.id.contentframe, myFragment, CUSTOM_TAG); // replace current fragment by myFragment
transac.commit();
Run Code Online (Sandbox Code Playgroud)
commit()
通话结束后,旧片段消失,显示空白屏幕几毫秒,然后显示新片段.
有谁知道我怎么能避免在交易过程中显示这个空白屏幕?
谢谢.