我试图通过电子邮件发送通过我的应用程序点击的图片作为附件.单击图片并且我正确地获取路径但是应用程序抛出了运行时异常.."没有找到处理Intent的活动".我正在我的设备上测试这个,我配置了我的Gmail帐户.我不知道如何解决这个问题.请帮忙.
这是我的代码:
public static void sendEmail(Context context, String[] recipientList, String title, String subject, String body) {
Intent intent = new Intent(Intent.ACTION_SENDTO, Uri.parse("mailto:someone@example.com"));
intent.setType("plain/text");
intent.putExtra(android.content.Intent.EXTRA_EMAIL, recipientList);
intent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject);
intent.putExtra(android.content.Intent.EXTRA_TEXT, body);
intent.putExtra(Intent.EXTRA_STREAM, capturedImageFilePath);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(intent);
}
Run Code Online (Sandbox Code Playgroud)
这是日志:
01-15 11:26:04.455: E/AndroidRuntime(9904): FATAL EXCEPTION: main
01-15 11:26:04.455: E/AndroidRuntime(9904): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.SENDTO typ=plain/text flg=0x10000000 (has extras) }
01-15 11:26:04.455: E/AndroidRuntime(9904): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1512)
01-15 11:26:04.455: E/AndroidRuntime(9904): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1384)
01-15 11:26:04.455: E/AndroidRuntime(9904): at android.app.ContextImpl.startActivity(ContextImpl.java:852)
01-15 11:26:04.455: E/AndroidRuntime(9904): at android.content.ContextWrapper.startActivity(ContextWrapper.java:276)
01-15 11:26:04.455: …Run Code Online (Sandbox Code Playgroud) 我试图在横向模式下全屏显示youtube播放器,但它无法正常工作.我放
player.setFullscreenControlFlags(YouTubePlayer.FULLSCREEN_FLAG_CONTROL_ORIENTATION);
player.setFullscreenControlFlags(YouTubePlayer.FULLSCREEN_FLAG_ALWAYS_FULLSCREEN_IN_LANDSCAPE);
Run Code Online (Sandbox Code Playgroud)
但例外情况即将来临:
java.lang.IllegalArgumentException: Can not set FULLSCREEN_FLAG_FULLSCREEN_WHEN_DEVICE_LANDSCAPE without setting FULLSCREEN_FLAG_CONTROL_ORIENTATION
03-21 16:10:09.892: E/AndroidRuntime(15996): at com.google.android.youtube.player.internal.r$a.handleMessage(Unknown Source)
Run Code Online (Sandbox Code Playgroud) 我用了
Intent sharingIntent = new Intent(Intent.ACTION_SEND);
Uri screenshotUri = Uri.parse("file//res/drawable/u.png");
sharingIntent.setType("image/png");
sharingIntent.putExtra(Intent.EXTRA_STREAM, screenshotUri);
startActivity(Intent.createChooser(sharingIntent, "Share image using"));
Run Code Online (Sandbox Code Playgroud)
//我使用sumsung real为device.and我选择在facebook上分享.//但是内容是空的而不是我的共享图像我无法共享图像.
这是意图动作发送不使用facebook sdk.你能帮我吗?
嗨,我尝试使用以下方法检查网络连接和Internet存在
check = new ConnectionDetector(getApplicationContext());
conn = check.isConnectingToInternet();
public class ConnectionDetector {
private Context _context;
public ConnectionDetector(Context context){
this._context = context;
}
/**
* Checking for all possible internet providers
* **/
/*public boolean isConnectingToInternet(){
ConnectivityManager connectivity = (ConnectivityManager) _context.getSystemService(Context.CONNECTIVITY_SERVICE);
if (connectivity != null)
{
NetworkInfo[] info = connectivity.getAllNetworkInfo();
if (info != null)
for (int i = 0; i < info.length; i++)
if (info[i].getState() == NetworkInfo.State.CONNECTED)
{
return true;
}
}
return false;
}*/
public boolean isConnectingToInternet(){
try{
ConnectivityManager cm …Run Code Online (Sandbox Code Playgroud) 我试图运行Spydroid应用的.但是,一旦它运行在我的Nexus 4上,就会遇到"不幸的Spydroid已停止".
我使用egit将代码的副本抓取到eclipse中的新项目中.那时,它抛出了一些错误,告诉我右键单击该项目并选择Android Tools - > Fix Project Properties.我按照它说的那样做了然后点击运行,将其上传到Nexus 4,安装它,当它试图运行时是我遇到崩溃.
我在结账/设置过程中做错了吗?我在该项目的谷歌代码页上发布了类似的帖子
logcat的:
03-28 02:59:20.028: D/AndroidRuntime(31294): Shutting down VM
03-28 02:59:20.028: W/dalvikvm(31294): threadid=1: thread exiting with uncaught exception (group=0x41920930)
03-28 02:59:20.028: E/AndroidRuntime(31294): FATAL EXCEPTION: main
03-28 02:59:20.028: E/AndroidRuntime(31294): java.lang.RuntimeException: Unable to instantiate application net.majorkernelpanic.spydroid.SpydroidApplication: java.lang.ClassNotFoundException: Didn't find class "net.majorkernelpanic.spydroid.SpydroidApplication" on path: /data/app/net.majorkernelpanic.spydroid-1.apk
03-28 02:59:20.028: E/AndroidRuntime(31294): at android.app.LoadedApk.makeApplication(LoadedApk.java:504)
03-28 02:59:20.028: E/AndroidRuntime(31294): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4364)
03-28 02:59:20.028: E/AndroidRuntime(31294): at android.app.ActivityThread.access$1300(ActivityThread.java:141)
03-28 02:59:20.028: E/AndroidRuntime(31294): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1294)
03-28 02:59:20.028: E/AndroidRuntime(31294): at android.os.Handler.dispatchMessage(Handler.java:99) …Run Code Online (Sandbox Code Playgroud) {
"TABLE":[
{
"ROW":[
{
"COL":[
{
"DATA":"< OutBoundSMS PhoneId='3' PhoneNo='1111111111' MessageText='OutBound SMS Application Test' />"
}
]
}
]
}
]
}
Run Code Online (Sandbox Code Playgroud)
如何像这种格式解析json数组?
解析时我收到此错误:"无法转换为json对象".