我正在尝试截取当前正在播放的视频.我正在尝试使用能够成功获取网络视图截图的代码,但却没有成功拍摄当前播放视频的照片.
Web视图的代码如下.
WebView w = new WebView(this);
w.setWebViewClient(new WebViewClient()
{
public void onPageFinished(WebView view, String url)
{
Picture picture = view.capturePicture();
Bitmap b = Bitmap.createBitmap( picture.getWidth(),
picture.getHeight(), Bitmap.Config.ARGB_8888);
Canvas c = new Canvas( b );
picture.draw( c );
FileOutputStream fos = null;
try {
fos = new FileOutputStream( "/sdcard/yahoo_" +System.currentTimeMillis() + ".jpg" );
if ( fos != null )
{
b.compress(Bitmap.CompressFormat.JPEG, 90, fos );
fos.close();
}
} catch( Exception e )
{
//...
}
}
});
setContentView( w );
w.loadUrl( …Run Code Online (Sandbox Code Playgroud) 我想在android应用程序中显示包含名称,ID,生日,位置等信息的列表.
虽然下面的代码我得到了朋友的名字和身份证,但我在工作中取得了成功
Bundle parameters = new Bundle();
mAccessToken = facebook.getAccessToken();
try {
parameters.putString("format", "json");
parameters.putString(TOKEN, mAccessToken);
String url = "https://graph.facebook.com/me/friends";
String response = Util.openUrl(url, "GET", parameters);
JSONObject obj = Util.parseJson(response);
Log.i("json Response", obj.toString());
JSONArray array = obj.optJSONArray("data");
if (array != null) {
for (int i = 0; i < array.length(); i++) {
String name = array.getJSONObject(i).getString("name");
String id = array.getJSONObject(i).getString("id");
Log.i(name,id);
}
}
............
............
Run Code Online (Sandbox Code Playgroud)
但不能在json响应中获取生日,位置等字段.什么是错误?
我有一些情况,我想在另一个类中使用另一个类的内部类.喜欢...
public class ListData {
public static class MyData {
public String textSongName, textArtistName, textDuration, textDownloadPath,
textSongSize, textAlbumName, textUrl;
public boolean enable;
public MyData(String songName, String artistName, String duration,
String downloadPath, String songSize, String albumName,
String url, boolean e) {
textSongName = songName;
textArtistName = artistName;
textDuration = duration;
textDownloadPath = downloadPath;
textSongSize = songSize;
textAlbumName = albumName;
textUrl = url;
enable = e;
}
}
}
Run Code Online (Sandbox Code Playgroud)
现在我想在另一个中使用Mydata类.
我怎样才能做到这一点?
谢谢.
我想知道设备上当前的互联网连接?
在android中我发现这两个属性知道网络类型如...
ConnectivityManager.TYPE_WIFI
ConnectivityManager.TYPE_MOBILE
但如何了解3G网络?
请帮助我
提前致谢!
我在android开发中的新功能.
我想在Android中创建自定义标签栏,如Iphone标签栏.我找到了很多这样做的例子.但我想只使用一个XML文件用于标签栏,然后将这些文件包含在屏幕中.我认为有可能在布局的帮助下,但我没有太多的想法.
如果布局只有一个属性,则在底部实现组件.
如果有人这样做请提供一些想法.
谢谢
可能重复:
如何在卸载时删除应用程序创建的文件?
我们在Android上制作了一个流媒体播放器.在我的应用程序中,每15分钟向服务器发送一个事件文件.可能是手机内存中的某些文件存储.
应用程序卸载时如何删除所有文件?
请帮帮我.
谢谢
在我的一个课程中,我有很多这样的构造函数.
public MyData(int position,String songName,String duration, boolean e) {
//initialization of above variable like int, string,string and boolean
}
public MyData(String songName, String artistName, String duration,String downloadPath, String songSize, String albumName,String url,String trackId, boolean e)
{
//initialization of above variable like String,String,String,String,String,String,String,String and boolean
}
Run Code Online (Sandbox Code Playgroud)
还有一些像上面那样.现在是调用时间,我只调用那个我需要数据的构造函数.但我不认为我的流程是好的,所以我需要一些帮助来减少我的代码以及创建良好的流程.如果有人有良好的流程来实现这一目标,那么请分享.
提前致谢.
我需要从网上列出数据,因为我有1张图片和2张文字.我解析所有数据并显示它,但图像显示在列表中非常慢.所以我正在寻找最好的方法来做到这一点.
请帮帮我.
提前致谢
android ×6
java ×2
3g ×1
connection ×1
constructor ×1
facebook ×1
layout ×1
listview ×1
overloading ×1
uninstall ×1
video ×1