其实我想通过意图在Instagram上分享图像.
我找到了保存在SD卡上的图像的解决方案,但我想对网站上的图像(链接)做同样的事情.
我试过了
Intent shareIntent = new Intent(android.content.Intent.ACTION_SEND);
shareIntent.setType("image/*");
shareIntent
.putExtra(
Intent.EXTRA_STREAM,
Uri.parse("http://www.alliswell.biz/images/products/art/alliswell_signs/yellowB.jpg"));
shareIntent.setPackage("com.instagram.android");
startActivity(shareIntent);
Run Code Online (Sandbox Code Playgroud)
但它不起作用.
当我开始上面的意图它打开我安装的Instagram应用程序,它立即完成Instagram和烤面包消息"无法下载文件"
实际上它并不分别解析链接和图像.应该是什么问题?
每次创建片段实例并在按下时重新加载。
如何克服这个问题?
导航控制器中无法具有适当的后置堆栈是一个巨大的生产率问题。希望这是缺少功能或变通是故意... IMO这是一个必须具备的,并已被宜早不宜迟介绍(但是:https://issuetracker.google.com/issues/109856764说我们将不会被允许交易类型的自定义(如隐藏/显示等)在可预见的未来。):(
有人有解决方案吗?
我的代码是使用导航进行导航
object NavigationHelper : Navigational {
override fun moveDownWithPop(view: View,id: Int,popStackId: Int) {
Navigation.findNavController(view).navigate(id,
null,
NavOptions.Builder()
.setPopUpTo(popStackId,
true).build()
)
}
override fun moveDownWithDataPop(view: View,id: Int,popStackId: Int,bundle : Bundle) {
Navigation.findNavController(view).navigate(id,
bundle,
NavOptions.Builder()
.setPopUpTo(popStackId,
true).build()
)
}
override fun moveUp(view: View) {
Navigation.findNavController(view).navigateUp()
}
override fun moveDown(view: View,id: Int) {
Navigation.findNavController(view).navigate(id)
}
override fun moveDown(view: View,id: Int,args : Bundle) {
Navigation.findNavController(view).navigate(id,args)
}
fun navigateGraph(graphId : Int,context : Context){
var finalHost: NavHostFragment? …Run Code Online (Sandbox Code Playgroud) android fragment-backstack android-architecture-navigation androidx
我以前实施了乱舞.它工作正常.今天有新版本的sdk,flurry不会在logcat中记录任何东西.
我的代码
Flurry.java
public class Flurry {
private static final String API_KEY = "xxxxxxxxxxxxxxxxxxxxxx";
private static Context mContext;
public static void init(Context c) {
mContext = c;
}
public static Context getContext() {
return mContext;
}
public static void onStartSession() {
if (mContext != null) {
Debug.e("", "startng flurry session...");
FlurryAgent.setUserId(Utils.getUserId(mContext));
FlurryAgent.setVersionName(Utils.getAppVersion(mContext));
FlurryAgent.setLogEnabled(true);
FlurryAgent.setLogEvents(true);
FlurryAgent.onStartSession(mContext, API_KEY);
// FlurryAgent.initializeAds(mContext);
} else {
Debug.e("", "mContext is null");
}
}
public static void onEndSession() {
if (mContext != null) {
Debug.e("", "ending flurry …Run Code Online (Sandbox Code Playgroud) 我从昨晚起就遇到了这种错误.我不知道发生了什么事.我身边有什么问题吗?我没有更改我的代码,但当我清除数据或我重新安装应用程序时,它显示我... .... !!!!!! 无奈........
05-05 04:18:16.000: E/Finsky(17538): [1] NotifyingErrorListener.onErrorResponse: Server error on InAppPurchaseInformationRequest: com.android.volley.ServerError
05-05 04:18:16.010: D/Finsky(17538): [1] MarketBillingService.sendResponseCode: Sending response RESULT_SERVICE_UNAVAILABLE for request 227869xxxxxxx6110 to com.mypackage.
MarketBillingService.sendResponseCode: Sending response RESULT_ERROR for request 227869xxxxxxx6110 to com.mypackage.
Run Code Online (Sandbox Code Playgroud)
有人说从市场重新安装应用程序..是一个解决方案,但还有其他任何方式?????
我只是想知道我身边有什么问题......?
android应用程序内计费 - restoreTransactionInformation说"虽然你不需要用CONFIRM_NOTIFICATIONS消息来回应这个意图".如果我实现了这个,但任何人都有这方面的经验,那将是很棒的.
帮我
提前致谢...
我的应用程序支持3种密度ldpi(120),mdpi(160),hdpi(320),为此我们有三个资源文件夹(ldpi,mdpi,hdpi).
但是我的问题出现在HTC感觉XE(540x960),密度大约为256 dpi.我的资源被拉长了.
在清单文件中
<supports-screens android:xlargeScreens="false" />
Run Code Online (Sandbox Code Playgroud)
意味着我不支持xlarge屏幕,所以540x960是否具有高密度?我怎么能克服这个问题?
Android Multiscreen支持问题说:" 你也可以使用密度和大小限定符的组合,但仍然留有一些空间让两个不同的分辨率落入同一个存储桶中. "
对于这种分辨率,drawble文件夹的名称应该是什么?还是有其他方法来缩短这个问题.
编辑:我的问题不是布局,我的问题540x960来自HDPI但我的hdpi drawbles设计与480x800相关
帮我..
提前致谢..
我的函数之一获取类型变量。有时可以java.util.List<Test$MyClass>,java.util.List<java.lang.String>那么我如何识别它们?
if (type instanceof List) {
}
Run Code Online (Sandbox Code Playgroud)
两者都是List类型,但类型不同。所以上面的代码不起作用。我想区分这两种列表类型。
我的主要问题是/sf/ask/1091727871/
我正在用deserializer这个..
public class Data implements JsonDeserializer<ArrayList<MyClass1>> {
public ArrayList<MyClass1> myList1 = new ArrayList<MyClass1>();
public ArrayList<MyClass2> myList2 = new ArrayList<MyClass2>();
@Override
public ArrayList<MyClass1> deserialize(JsonElement json, Type type,
JsonDeserializationContext context) throws JsonParseException {
Debug.e("", type.toString());
ArrayList<Layoutmap> data = new ArrayList<Layoutmap>();
try {
if (json.isJsonObject()) {
// my stuff
return data;
} else {
return new Gson().fromJson(json, type);
}
} catch (Exception e) {
e.printStackTrace(); …Run Code Online (Sandbox Code Playgroud) 我之前的播放服务版本是6.5.87,我升级到7.0.0然后出现此错误
com.android.ide.common.process.ProcessException:org.gradle.process.internal.ExecException:进程'命令'C:\ Program Files\Java\jdkx.x.x_xx\bin\java.exe''以非结束 - 零退出值2
compile 'com.google.android.gms:play-services:6.5.87'
Run Code Online (Sandbox Code Playgroud)
我已经升级了游戏服务然后....现在我的gradle是
dependencies {
compile project(':com_facebook_android')
compile project(':pullToRefreshLib')
compile project(':smoothProgressbarLib')
compile project(':progressMaterial')
compile 'com.android.support:support-v4:22.0.0'
compile 'com.google.android.gms:play-services:7.0.0'
compile 'com.google.code.gson:gson:2.3'
compile 'com.jakewharton:butterknife:6.1.0'
compile files('libs/android-async-http-1.4.6.jar')
compile files('libs/commons-io-2.4.jar')
compile files('libs/google-api-client-1.4.1-beta.jar')
compile files('libs/google-api-client-googleapis-1.4.1-beta.jar')
compile files('libs/jackson-core-asl-1.6.7.jar')
compile files('libs/jeval.jar')
compile files('libs/jscience.jar')
compile files('libs/libGoogleAnalyticsV2.jar')
compile files('libs/nineoldandroids-2.4.0.jar')
compile files('libs/universal-image-loader-1.9.3.jar')
compile files('libs/YouTubeAndroidPlayerApi.jar')
compile files('libs/guava-r09.jar')
Run Code Online (Sandbox Code Playgroud)
有没有冲突库?
我想在有backpress / manual back发生时获取数据。我navigateUp()过去经常回去。如何将数据传递到上一个片段?navigateUp()没有任何工具可以将数据传递到上一个片段。甚至我也没有找到使用Safe Args的解决方案。它正在转发数据。我想在向后的Frad B-> Frag A中使用。
我的代码回到上一个片段
Navigation.findNavController(view).navigateUp()
Run Code Online (Sandbox Code Playgroud)
我的问题是,如何获取上一个片段中的数据。我可以使用以下方法从Frag B导航至Frag A
android android-fragments android-architecture-navigation android-safe-args
我已经实施了APK扩展文件下载服务,全部来自http://developer.android.com/google/play/expansion-files.html
我可以下载APK扩展文件,我可以使用下面的代码看到该文件
try {
ZipResourceFile expansionFile = APKExpansionSupport
.getAPKExpansionZipFile(this, 3, 0);
ZipEntryRO[] zip = expansionFile.getAllEntries();
Log.e("", "" + zip[0].mFile.getAbsolutePath());
Log.e("", "" + zip[0].mFileName);
Log.e("", "" + zip[0].mZipFileName);
Log.e("", "" + zip[0].mCompressedLength);
AssetFileDescriptor fd = expansionFile
.getAssetFileDescriptor(zip[0].mFileName);
if (fd != null && fd.getFileDescriptor() != null) {
MediaPlayer mp = new MediaPlayer();
mp.setDataSource(fd.getFileDescriptor());
mp.start();
} else {
Log.e("", "fd or fd.getFileDescriptor() is null");
}
} catch (IOException e) {
e.printStackTrace();
}
Run Code Online (Sandbox Code Playgroud)
我的obb有文件test.mp4和我的代码Log.e("", "" + zip[0].mFileName);打印test.mp4.
我的 …
我想根据光线改变屏幕的亮度..
我找到了获取亮度级别和设置亮度的链接.
但我想根据周围的光线改变亮度.总之,我想做与自动亮度相同的工作.
如何检测周围光线?或者我可以触发自动亮度功能??
亮度的值范围在0到255之间.我想根据周围的亮度设置亮度等级,不能是0到255.如何获得这两者之间的比例.
需要帮助.谢谢
我想改变颜色的亮度
我实现了这个...
Settings.System.putInt(context.getContentResolver(),android.provider.Settings.System.SCREEN_BRIGHTNESS, 200);
Run Code Online (Sandbox Code Playgroud)
这将改变我的设备在黑白模式下的亮度。


像上面的图片,我可以改变亮度,但我怎样才能给颜色?还有其他我不知道的参数吗?
我想通过Flickr,Tumblr,Instagram分享图片.我想用这3个已安装的应用程序执行此操作.我找到了Instagram:
Intent shareIntent = new Intent(Intent.ACTION_SEND);
shareIntent.setType("image/*");
shareIntent.putExtra(Intent.EXTRA_TEXT, "" + getShareText());
shareIntent.putExtra(Intent.EXTRA_SUBJECT, "" + getShareText());
shareIntent.putExtra(Intent.EXTRA_STREAM,
Uri.parse("file://" + file.getAbsolutePath()));
shareIntent.setPackage("com.instagram.android");
Run Code Online (Sandbox Code Playgroud)
我也可以拥有Tumblr和Flickr吗?是的,我可以通过集成库来完成Oauth流程.但我想通过特定安装的应用程序分享.
我想检测'哨声'的声音.为此,我实施了http://code.google.com/p/musicg/
源代码本身有问题.当您启动应用程序时,它已准备好进行监听,但当您返回并再次重新启动探测器线程时,它不会触发哨子检测.
DetectorThread.java
package weetech.wallpaper.services;
import java.util.LinkedList;
import weetech.wallpaper.utils.Debug;
import android.media.AudioFormat;
import android.media.AudioRecord;
import com.musicg.api.WhistleApi;
import com.musicg.wave.WaveHeader;
public class DetectorThread extends Thread {
private RecorderThread recorder;
private WaveHeader waveHeader;
private WhistleApi whistleApi;
private Thread _thread;
private LinkedList<Boolean> whistleResultList = new LinkedList<Boolean>();
private int numWhistles;
private int totalWhistlesDetected = 0;
private int whistleCheckLength = 3;
private int whistlePassScore = 3;
public DetectorThread(RecorderThread recorder) {
this.recorder = recorder;
AudioRecord audioRecord = recorder.getAudioRecord();
int bitsPerSample = 0;
if (audioRecord.getAudioFormat() == AudioFormat.ENCODING_PCM_16BIT) { …Run Code Online (Sandbox Code Playgroud) android ×13
android-architecture-navigation ×2
instagram ×2
analytics ×1
androidx ×1
audio ×1
brightness ×1
dependencies ×1
flickr ×1
flurry ×1
gson ×1
java ×1
tumblr ×1