我需要为用户提供功能,用户可以通过发送电子邮件来共享某些数据.我使用下面的代码.
Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
emailIntent.setType("text/html");
emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "testing email send.");
emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, Html.fromHtml("<b>this is html text in email body.</b>"));
startActivity(Intent.createChooser(emailIntent, "Email to Friend"));
Run Code Online (Sandbox Code Playgroud)
这显示了邮件应用程序,gmail和蓝牙供用户选择.我不希望用户在此列表中显示蓝牙.我需要做什么 ?我有Facebook应用程序,它做同样的事情,但没有在列表中显示蓝牙.我需要做同样的事情.
可能重复:
Android中的水平ListView?
我想要像Gallery这样的水平滚动.我没有使用Gallery因为它的中心被锁定了.
这里有人可以帮我解决这个问题所以我可以有水平滚动列表吗?
我认为最好的例子是脉冲新闻阅读器: - https://market.android.com/details?id=com.alphonso.pulse
谢谢 :)
我一直在研究Android手机用户选择的日期格式问题.我在stackoverlow上经历了几乎所有的问题和答案,并没有得到完美的答案.例如: - 我在手机中选择了dateformat是"星期六,2011年12月31日"但是当我在stackoverflow上使用基于问题的答案: -
DateFormat df = android.text.format.DateFormat.getDateFormat(context.getApplicationContext());
tv.setText(df.format(date));
Run Code Online (Sandbox Code Playgroud)
上面的代码返回06/08/2011(mm/dd/yyyy)格式.但请参阅我在手机上选择的日期格式.我怎样才能得到确切的格式?
可能重复:
android gallery图像位置问题
我正在我的应用中使用图库视图.现在我运行代码.图库默认选中的项目为1,位于中心,左侧为空白.相反,我希望没有1项应该在左边并选中.同时单击任何图库项目不应将该项目置于中心.
我厌倦了在群体上狩猎,但没有找到任何解决方案.这可能吗?如果是,那么怎么样?
我试图从给定的字符串中获取HTML图像标记网址.应该有一些正则表达式来获得它.但不知道该怎么做.谁可以帮我这个事.
例如
I have string like this with <br> some HTML<b>tag</b>
with <img src="http://xyz.com/par.jpg" align="left"/> image tags in it.
how can get it ?
Run Code Online (Sandbox Code Playgroud)
我只想要来自字符串的http://xyz.com/par.jpg
我在提交中生成差异/更改,以便我可以在ReviewBoard中上传它.
我使用了"git show d9f7121e8ebd4d1f789dab9f8214ada2h480b9cf".它给了我差异......
diff --git a/src/index.php b/src/index.php
index 3cfa8e8..7f8440d 100644
--- a/src/index.php
+++ b/src/index.php
@@ -12,10 +12,13 @@
.test {
.input;
width: auto;
+ border-width: 5px;
+ border-radius: 50%;
}
Run Code Online (Sandbox Code Playgroud)
当我创建这个差异的.patch文件时.Reviewboard拒绝它说"'3cfa8e8'修订版无效格式.SHA1太短".
所以我想从短SHA1'3cfa8e8'获得长SHA1.
我做了'git show 3cfa8e8'.它只是向我展示了一些文件内容.没有给我任何其他信息.
任何帮助我如何获得长SHA?
(注意: - 所有sha和文件差异都是示例来说明问题)
我正在使用.war文件在我的服务器上运行jenkins.他们说使用
java -jar jenkins.war
Run Code Online (Sandbox Code Playgroud)
(来源:https://wiki.jenkins-ci.org/display/JENKINS/Starting+and+Accessing+Jenkins)启动服务器.这将启动服务器并显示登录屏幕并准备使用.
唯一的问题是当我"ctrl + c"它停止服务器.我希望它应该在后台启动,这样即使我从putty退出它应该运行.我知道如果使用本机包".deb"它将作为服务安装但我想只使用".war"文件而不是本机包".deb".它甚至可能吗?
我已经在机器人指南上使用了给定的教程,并在按下设备或菜单项上的搜索按钮后仍然完成了所有需要的操作.它不会打开搜索对话框.我从这里获得了教程http://developer.android.com/guide/topics/search/search-dialog.html
我必须在这里发布我的示例代码,以便你们可以查看它并尽可能提供帮助,这样我就可以知道我哪里出错了.应出现对话框的活动
<activity android:name=".testAndroid"
android:theme="@android:style/Theme.NoTitleBar">
<meta-data android:name="android.app.default_searchable"
android:value="com.tester.android.Search" />
</activity>
Run Code Online (Sandbox Code Playgroud)
返回搜索结果的活动
<activity android:name=".Search" android:label="Search">
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<meta-data android:name="android.app.searchable" android:resource="@xml/searchable"/>
</activity>
Run Code Online (Sandbox Code Playgroud)
我在res/xml文件夹中的可搜索文件
<?xml version="1.0" encoding="utf-8"?>
<searchable xmlns:android="http://schemas.android.com/apk/res/android"
android:label="XYZ.com"
android:hint="Search XYZ.com" >
</searchable>
Run Code Online (Sandbox Code Playgroud)
显示结果的活动
public class Search extends ListActivity {
private Vector<?> loadedArticles;
@Override
protected void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.articles);
Intent intent = getIntent();
String query="";
if (Intent.ACTION_SEARCH.equals(intent.getAction())) {
query = intent.getStringExtra(SearchManager.QUERY);
}
boolean articlesLoaded = findArticles(query); // it shows results and …Run Code Online (Sandbox Code Playgroud) 我有一个应用程序,它在第一次启动时启动服务.之后,它会定期从服务器中提取数据.
我打开了我的活动,如果有刷新按钮,我已经有了已经在后台获取数据的服务,那时我想要禁用按钮,加载新数据后我必须在活动中显示它并启用刷新按钮.
如果活动未运行,则应显示通知.
所以第二点是最容易做到的.我坚持认为1.如何定期向服务中的活动发送数据?我正在使用数据库来存储数据.
对此有何帮助?
我在市场上发布了应用程序.以下是提供的链接.我有HTC Wildfire和Desire.两者都有android 2.2
https://market.android.com/details?id=com.cricket.fast
现在我可以看到这个,并在HTC Desire上安装这个应用程序,但我不能在HTC Wildfire市场上看到这个.
但是,如果我手动安装应用程序,它可以工作,那么为什么市场上没有列出HTC Wildfire?
在构建应用程序时,我的目标SDK是8,minSDK是3.
这是什么问题.有人可以看一下链接并帮助我吗?
[更新]下面是清单代码.我在这里复制粘贴时删除了我的6个活动.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.cricket.fast"
android:versionCode="1"
android:versionName="0.1">
<application android:icon="@drawable/appicon" android:label="@string/app_name">
<activity android:name=".DashboardActivity"
android:theme="@android:style/Theme.NoTitleBar"
android:screenOrientation="portrait"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<uses-sdk android:minSdkVersion="3" />
<uses-permission xmlns:android="http://schemas.android.com/apk/res/android"
android:name="android.permission.INTERNET"></uses-permission>
<uses-permission xmlns:android="http://schemas.android.com/apk/res/android"
android:name="android.permission.ACCESS_NETWORK_STATE"></uses-permission>
</manifest>
Run Code Online (Sandbox Code Playgroud)
谢谢