我有这个代码:
Intent intent = new Intent();
intent.setAction(Intent.ACTION_SEND);
startActivity(intent);
Run Code Online (Sandbox Code Playgroud)
哪个将成功在Android上启动消息应用程序.
但是,如何在启动意图时附加Bitmap对象?
我已经阅读了http://developer.android.com/reference/Android/content/Intent.html,我需要的东西就是EXTRA_STREAM,就像这样:
intent2.putExtra(Intent.EXTRA_STREAM,_uri);
但我的情况是,我有一个Bitmap对象的引用,而不是Bitmap的URI.
请告诉我如何附加Bitmap对象?
我最近在Windows7 64位笔记本电脑中安装了JAVA7。之后Java无法正常运行,我无法找到
的javac.exe在C:\ Program Files文件\的Java \ jre7 \ bin中。
我卸载并安装了3到4次,但没有用。请帮我。
谢谢
根据我的知识,Singleton Design Pattern意味着我们只能创建一个类的单个对象.
以下代码成功运行,没有任何错误/异常.
我希望代码失败,因为SingletonExample该类有一个私有的默认构造函数.
public class SingletonExample {
private static SingletonExample singletonInstance;
private SingletonExample() {
}
public static SingletonExample getSingletonInstance() {
if (null == singletonInstance) {
System.out.println("Creating new instance");
singletonInstance = new SingletonExample();
}
return singletonInstance;
}
public void printSingleton(){
System.out.println("Inside print Singleton");
}
public static void main(String a[]) {
SingletonExample singObj1 = new SingletonExample();
SingletonExample singObj2 = new SingletonExample();
}
}
Run Code Online (Sandbox Code Playgroud)
我的代码有问题吗?
您好我的应用程序相对布局背景没有拉伸全屏.它显示如下
我的xml文件::
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#CACACA"
android:orientation="vertical" >
Run Code Online (Sandbox Code Playgroud)