Tag: android 2.2 froyo

找不到处理Intent的活动:android.intent.action.VIEW

这是我的代码来播放录制的audio3gp文件 Intent intent = new Intent(android.content.Intent.ACTION_VIEW); Uri data = Uri.parse(path); intent.setDataAndType(data, "audio/mp3"); startActivity(intent); 但在HTC设备( Android 2.2 Froyo )中运行时却显示出一个exception 05-04 16:37:37.597: WARN/System.err(4065): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=/mnt/sdcard/mnt/sdcard/audio-android.3gp typ=audio/mp3 } 05-04 16:37:37.597: WARN/System.err(4065): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1567) 05-04 16:37:37.597: INFO/ActivityManager(92): Starting activity: Intent { act=android.intent.action.VIEW dat=/mnt/sdcard/mnt/sdcard/audio-android.3gp typ=audio/mp3 } 05-04 16:37:37.607: WARN/System.err(4065): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1537) 05-04 […]

为什么不能从ArrayAdapter中添加/删除项目?

我正在使用一个ArrayAdapter<CharSequence>来填充要在android.widget.Spinner列出的项目。 这工作都很好。 但现在我想保持项目的dynamic列表,即我希望能够在运行时从select列表中添加/删除项目。 然而,当我调用adapter.add(item)或adapter.remove(item)我总是得到一个UnsupportedOperationException adapter.remove(item) ,尽pipeArrayAdapter类的Javadocs将这两种方法描述为可用于完全达到预期的目的。 这是一个错误,真的没有实现,或者我在这里错过了什么?

Android的; 地理编码器,为什么我会得到“服务不可用”?

我想在Android应用程序中使用地理编码器,我有以下一段代码来对其进行采样: public class LocatorGeo extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Geocoder geo = new Geocoder(getApplicationContext()); List<Address> myAddrs = new ArrayList<Address>(); try { myAddrs = geo.getFromLocationName("CO100AR", 1); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } 我得到以下堆栈跟踪: […]

当我的活动不可见时,如何在Android WebView中暂停Flash内容?

我正在尝试使用WebView在我的活动中显示Flash内容。 一切工作都很好,但是当用户点击home键将活动放到后台时,Flash内容会继续运行(声音继续播放等) 我注意到,Android浏览器和Dolphin浏览器似乎都避免了这个问题,并且当浏览活动放到后台时,可以正确地暂停Flash内容。 理想情况下,我想要一个解决scheme,完全杀死WebView,如果活动结束,但暂停,否则(基本上复制浏览器的默认行为) 这里有一个简单的testing,我把它放在Kongregate上加载了一些背景音乐: public class BrowserTest extends Activity { private WebView mWebView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mWebView = new WebView(this); mWebView.getSettings().setJavaScriptEnabled(true); mWebView.getSettings().setPluginsEnabled(true); mWebView.loadUrl("http://m.kongregate.com/games/Jiggmin/the-game-of-disorientation-mobile"); setContentView(mWebView); } @Override protected void onPause(){ super.onPause(); mWebView.pauseTimers(); if(isFinishing()){ mWebView.loadUrl("about:blank"); setContentView(new FrameLayout(this)); } } @Override protected void onResume(){ super.onResume(); mWebView.resumeTimers(); } } 我查看了股票浏览器的最新源代码,似乎正在做类似的事情(调用pauseTimers / resumeTimers),尽pipe我担心我一直在看的代码已经过时了,因为它调用的函数不是似乎再也不存在了。 我确实通过testing一个简单的JavaScript setInterval来更新一个计数器来调用pauseTimers。 […]

自定义SSL处理在Android 2.2 FroYo上停止工作

对于我的应用程序Transdroid,我通过HTTP连接到远程服务器,并通过HTTPS安全地连接。 对于这些与HttpClient HTTPS连接我使用自定义SSL套接字工厂实现,以确保自签名证书正在工作。 基本上,我接受一切,忽略任何证书的检查。 这一直在罚款一段时间了,但它不再适用于Android 2.2 FroYo。 当试图连接时,它将返回一个exception: java.io.IOException: SSL handshake failure: I/O error during system call, Broken pipe 这里是我如何初始化HttpClient: SchemeRegistry registry = new SchemeRegistry(); registry.register(new Scheme("http", new PlainSocketFactory(), 80)); registry.register(new Scheme("https", (trustAll ? new FakeSocketFactory() : SSLSocketFactory.getSocketFactory()), 443)); client = new DefaultHttpClient(new ThreadSafeClientConnManager(httpParams, registry), httpParams); 我使用了一个FakeSocketFactory和FakeTrustManager,其中的源代码可以在这里find。 再一次,我不明白为什么突然停止工作,甚至是什么错误的“破pipe”意味着什么。 我在Twitter上看到了Seesmic和Twidroid在FroYo上启用SSL失败的消息,但是我不确定它是否有关系。 感谢您的任何指示/帮助!

ADT需要'org.eclipse.wst.sse.core 0.0.0',但找不到

我正在安装Fedora 14(Linux)的全新安装Android SDK。 我安装了eclipse,运行tools / android sdk工具来安装SDK的所有Eclipse组件。 当我自己selectDDMS时,我能够安装DDMS。 而对于最后一个组件 – Android开发人员工具,我得到了粘贴在下面的丑陋的错误消息。 现在我困在Eclipse的依赖地狱。 我已经通过Fedora中的可用软件包进行了search,找不到满足此Eclipse依赖关系的文件。 任何人都可以请求翻译Eclipse所要求的内容以及Fedora包的内容。 丑陋的错误: Cannot complete the install because one or more required items could not be found. Software being installed: Android Development Tools 0.9.9.v201009221407-60953 (com.android.ide.eclipse.adt.feature.group 0.9.9.v201009221407-60953) Missing requirement: Android Development Tools 0.9.9.v201009221407-60953 (com.android.ide.eclipse.adt.feature.group 0.9.9.v201009221407-60953) requires 'org.eclipse.wst.sse.core 0.0.0' but it could not be found

Android ADB设备脱机,无法发出命令

我无法通过命令行或在Eclipse中使用ADB连接到我的设备。 运行命令 adb devices 返回设备名称,但它说它是离线的。 我试过的东西。 切换Androiddebugging模式 重新安装Google USB驱动程序 恢复操作系统到以前的工作备份( CyanogenMod ) 交换了USB线 重新启动电话/电脑多次 更新了Android SDK 我真的没有任何线索是怎么回事。 还有什么你认为我可以尝试的,我全是耳朵。 要清楚的是,如果您遇到同样的问题,则问题可能是过时的SDK。 从4.2.2开始,有一个安全function需要您确认连接设备的RSA指纹。 打开SDKpipe理器并更新工具! 然后重启。

如何以编程方式在Androidbutton上设置drawableLeft?

我正在dynamic创buildbutton。 我首先使用XML对它们进行了样式devise,并且试图将下面的XML作为程序devise。 <Button android:id="@+id/buttonIdDoesntMatter" android:layout_height="wrap_content" android:layout_width="fill_parent" android:text="buttonName" android:drawableLeft="@drawable/imageWillChange" android:onClick="listener" android:layout_width="fill_parent"> </Button> 这是我迄今为止。 我可以做任何事情,但可绘制。 linear = (LinearLayout) findViewById(R.id.LinearView); Button button = new Button(this); button.setText("Button"); button.setOnClickListener(listener); button.setLayoutParams( new LayoutParams( android.view.ViewGroup.LayoutParams.FILL_PARENT, android.view.ViewGroup.LayoutParams.WRAP_CONTENT ) ); linear.addView(button);