我正在复制一个预先存在的数据库,/data/data/packagename/databases
使用从using-your-own-sqlite-database-in-android-applications中学到的代码
复制后,我在打开数据库时收到以下日志消息:
没有这样的表android_metadata
我是否需要创建一个名为android_metadata的表?我需要将值插入此数据库表中
非常感谢
我正在为Android编写一个应用程序,在我向程序添加了一个选项卡布局后出现错误:
转换为Dalvik格式失败,错误1
我已经尝试清理项目,并在本网站上查看问题的所有其他解决方案.有人还发现了一些模糊的解决方案吗?
我是新来的,我一直在寻找帮助我的问题,但我没有明确的答案.
我需要制作一个应用程序来阻止手机上的其他应用程序.我在市场上看过几个,但我想制作一个.有什么方法可以知道用户何时尝试打开应用程序并提出活动?(把密码).
我尝试使用FileObserver,但只适用于文件和目录(显然).我可以在开始之前创建一个捕获其他应用程序的Intent的侦听器吗?
我为我的英语道歉,感谢您的帮助!
我想通过Facebook上的分享意图与我的应用程序预先填充的标题分享照片.
我知道如何分享照片或如何分享文字,但我如何分享它们?
示例代码
Intent shareCaptionIntent = new Intent(Intent.ACTION_SEND);
shareCaptionIntent.setType("image/*");
//set photo
shareCaptionIntent.setData(examplePhoto);
shareCaptionIntent.putExtra(Intent.EXTRA_STREAM, examplePhoto);
//set caption
shareCaptionIntent.putExtra(Intent.EXTRA_TEXT, "example caption");
shareCaptionIntent.putExtra(Intent.EXTRA_SUBJECT, "example caption");
startActivity(Intent.createChooser(shareCaptionIntent,getString(R.string.share)));
Run Code Online (Sandbox Code Playgroud)
如果image/*
上传照片的设置类型,则不会预填充字幕.如果设置为text/plain
只有标题上传没有照片.....
我的猜测是问题是Android Facebook App Intent.EXTRA_TEXT
在过滤ACTION_SEND
带有image/*
照片上传类型的Intent 时不会查找.因此,如果Android Facebook应用程序查找该值,则可以解决此问题,如果存在,则将其作为图像的标题插入.
我的主要偏好活动设置为"@android:style/Theme.Light"
.我的一个偏好是DialogPreference,其Dialog包含ListView.ListView的对话框为深灰色(因为DialogPreference使用AlertBuilder创建深灰色对话框),列表中的文本为黑色(因为Theme.Light导致listViews有黑色文本).是否有一种简单的方法可以使ListView的行为与黑暗对话框相同?或者让黑暗的对话框表现出与灯光活动相同的风格?
编辑:
根据Merlin的评论,似乎我应该尝试做的是创建一个LightDialog主题.为了做到这一点,我试过:1.扩展android的Theme.Light并从Theme.Dialog添加对话框属性
<style name="Theme.LightDialog" parent="@android:style/Theme.Light">
<item name="android:windowFrame">@null</item>
<item name="android:windowTitleStyle">@android:style/DialogWindowTitle</item>
<item name="android:windowBackground">@android:drawable/panel_background</item>
<item name="android:windowIsFloating">true</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:windowAnimationStyle">@android:style/Animation.Dialog</item>
</style>
Run Code Online (Sandbox Code Playgroud)
...和2.扩展android的Theme.Dialog并添加Theme.Light的轻微属性.
<style name="Theme.LightDialog" parent="@android:style/Theme.Dialog">
<item name="android:windowBackground">@drawable/screen_background_light</item>
<item name="android:colorBackground">@android:color/background_light</item>
<item name="android:colorForeground">@androidcolor/bright_foreground_light</item>
<item name="android:colorForegroundInverse">@android:color/bright_foreground_light_inverse</item>
<item name="android:textColorPrimary">@android:color/primary_text_light</item>
<item name="android:textColorSecondary">@android:color/secondary_text_light</item>
<item name="android:textColorTertiary">@android:color/tertiary_text_light</item>
<item name="android:textColorPrimaryInverse">@android:color/primary_text_dark</item>
<item name="android:textColorSecondaryInverse">@android:color/secondary_text_dark</item>
<item name="android:textColorTertiaryInverse">@android:color/tertiary_text_dark</item>
<item name="android:textColorPrimaryDisableOnly">@android:color/primary_text_light_disable_only</item>
<item name="android:textColorPrimaryInverseDisableOnly">@android:color/primary_text_dark_disable_only</item>
<item name="android:textColorPrimaryNoDisable">@android:color/primary_text_light_nodisable</item>
<item name="android:textColorSecondaryNoDisable">@android:color/secondary_text_light_nodisable</item>
<item name="android:textColorPrimaryInverseNoDisable">@android:color/primary_text_dark_nodisable</item>
<item name="android:textColorSecondaryInverseNoDisable">@android:color/secondary_text_dark_nodisable</item>
<item name="android:textColorHint">@android:color/hint_foreground_light</item>
<item name="android:textColorHintInverse">@android:color/hint_foreground_dark</item>
</style>
Run Code Online (Sandbox Code Playgroud)
这两种尝试均失败,因为它们使用非公共属性.有关如何创建LightDialog主题的任何建议?
我有这个意图的问题.这个意图是为了发送文本类型的消息.一切都工作电子邮件,短信,推特和手机上的任何东西.但唯一有问题的是facebook,它会尝试发布链接而不是文本.
Intent s = new Intent(android.content.Intent.ACTION_SEND);
s.setType("text/plain");
s.putExtra(Intent.EXTRA_SUBJECT, "Quote");
s.putExtra(Intent.EXTRA_TEXT, qoute);
startActivity(Intent.createChooser(s, "Quote"));
Run Code Online (Sandbox Code Playgroud) 我有一些C++库.有没有办法以跨平台的方式在Silverlight中使用它们(在Linux/Mac/PC上)?如果可能,我不想使用C++/CLI.
我用谷歌搜索了这篇文章,说COM是唯一的方法.但是,我被告知Silverlight4支持PInvoke.
我有一个页面,用户必须在多个对象上启动操作,但Facebook设计限制您使用所需的元属性标记每页只有一个对象.
有没有人找到解决这个问题的方法?
我想在ListView中显示新闻(来自RSS).我已经成功创建了ListView,正确显示了标题和描述.但是我无法从URL显示图像.
这是我的代码:
maListViewPerso = (ListView) findViewById(R.id.listviewperso);
ArrayList <HashMap<String, String>> listItem = new ArrayList<HashMap<String, String>>();
HashMap<String, String> map;
int i = 0;
while (i < 55)
{
map = new HashMap<String, String>();
map.put("titre", newsArray[i]);
map.put("description", newsArray[i+1]));
map.put("img", newsArray[i+4]);
listItem.add(map);
i += 5;
}
SimpleAdapter mSchedule = new SimpleAdapter (this.getBaseContext(), listItem,
R.layout.affichageitem, new String[] {"img", "titre", "description"},
new int[] {R.id.img, R.id.titre, R.id.description});
maListViewPerso.setAdapter(mSchedule);
Run Code Online (Sandbox Code Playgroud)
你可以猜到,newsArray[i+4]
包含我的图像的URL.
我写了一个函数drawable_from_url
,它返回一个android.graphics.drawable.Drawable
并且工作正常.我试着写这个:
map.put("img", String.valueOf(drawable_from_url(newsArray[i+4], "newsPic")));
Run Code Online (Sandbox Code Playgroud)
但它也没有工作(没有显示图像).价值的一个例子
String.valueOf(drawable_from_url(newsArray[i+4], "newsPic"))
可能是
android.graphics.drawble.BitmapDrawable@481f16d0
任何的想法 ?
谢谢.