我想安装cocos2d来开发android中的游戏..所以任何人都可以帮我如何在android sdk上安装它?
请建议我安装它的步骤....
如果有任何其他工具可用于Android开发,那么请建议我..
谢谢 ..
我一直在为我的手机开发一个小应用程序,我想添加一个需要在屏幕上绘制圆圈的功能.我想知道如何使用OpenGL ES来做到这一点.有人可以帮忙吗?
Intent intent = new Intent(this,Name.class);
intent.putExtra("key", et.getText().toString());
startActivity(intent);
Intent intent = getIntent();
String str = intent.getStringExtra("key");
tv.setText(str);
Run Code Online (Sandbox Code Playgroud)
从使用上面的代码我可以获得其他活动的字符串值,但我需要editText
另一个活动的对象.
有谁可以给出想法?
谢谢
嗨,我是Android的新手.我正在实现具有通知功能的代码.在我的应用程序中,我有两个活动,分别是ActivityA和ActivityB.我想从通知启动ActivityB,我需要向ActivityB发送一些标志或一些值.如何使用click上的通知将int value或flag等数据发送到该被调用的活动.问题是当我从启动器图标启动活动时,它首先调用ActivityA,然后从ActivityA我将一些值传递给ActivityB.但是当我从通知中启动ActivityB时,我不会向该活动发送任何值,因此它会关闭力量.
要从通知中调用活动,我正在使用此代码
mNotificationManager = (NotificationManager)getSystemService(NOTIFICATION_SERVICE);
final Notification notifyDetails = new Notification(R.drawable.android,"New Alert, Click Me!",System.currentTimeMillis());
Context context = getApplicationContext();
CharSequence contentTitle = "Notification Details...";
CharSequence contentText = "Browse Android Official Site by clicking me";
Intent notifyIntent = new Intent(Intent.ACTION_MAIN);
notifyIntent.setComponent(new ComponentName("mypackage","mypackage.ActivityB"));
PendingIntent intent = PendingIntent.getActivity(SimpleNotification.this, 0,notifyIntent, android.content.Intent.FLAG_ACTIVITY_NEW_TASK);
notifyDetails.setLatestEventInfo(context, contentTitle, contentText, intent);
mNotificationManager.notify(SIMPLE_NOTFICATION_ID, notifyDetails);
Run Code Online (Sandbox Code Playgroud)
请告诉我如何将通知值发送到被叫活动.
Android的编程对我来说是新的.因此,日食也是新的.我一直在努力创造小东西.但是我发现每个例子都需要在main.xml中编辑.
我的问题是,每当我使用该文件时,我都会收到错误.我不知道是什么原因造成的.我不知道怎么摆脱它.
我试图在youtube上关注guid.遵循它的意义.仍然,得到错误.
有没有人知道导致这个问题的原因是什么?更重要的是:如何解决?
[2012-03-26 12:12:40 - No XML] emulator-5554 disconnected! Cancelling 'cyperia.noXML.NoXMLActivity activity launch'!
[2012-03-26 12:12:52 - No XML] Error in an XML file: aborting build.
[2012-03-26 12:13:00 - No XML] res\layout\main.xml:0: error: Resource entry main is already defined.
[2012-03-26 12:13:00 - No XML] res\layout\main.out.xml:0: Originally defined here.
[2012-03-26 12:13:00 - No XML] C:\Users\Illum\workspace\No XML\res\layout\main.out.xml:1: error: Error parsing XML: no element found
[2012-03-26 12:13:01 - No XML] 'default' is not a best match for any device/locale combination.
[2012-03-26 12:13:01 …
Run Code Online (Sandbox Code Playgroud) 我尝试通过开发者论坛寻找意图。我从中了解不多。\n尤其是这些行。
\n\n\xe2\x80\x9c Android 中的活动是通过称为意图的消息来激活的。意图消息传递是一种用于在相同或不同应用程序中的组件之间进行后期运行时绑定的工具。意图本身是一个 Intent 对象,是一个被动数据结构,保存要执行的操作的抽象描述。\xe2\x80\x9d
\n\n对此我有几个问题。
\n\n\n\n(a)为什么意图消息传递工具被视为组件之间的后期运行时绑定?
\n\n(b)为什么意图数据结构使用\xe2\x80\x9cpassive\xe2\x80\x9d这个词?
\n\n(c) 任何人都可以举例说明要执行的操作的抽象描述意味着什么?
\n
当我更改 edittext 的值时,我想添加带小数点的逗号分隔值吗?
当任何人根据 edittext 逗号中的数字更改 edittext 中的值时,我想实时执行此操作,应该添加或删除?
有没有办法让逗号作为小数点分隔符?
我一直在关注Android教程并创建了MyFirstApp(请参阅http://developer.android.com/training/basics/firstapp/index.html),我可以在模拟器上启动应用程序,但输入消息后点击" 发送 "我在下面的代码中的这一行得到一个由NullPointerException引起的IllegalStateException:
String message = editText.getText().toString();
Run Code Online (Sandbox Code Playgroud)
在调试时,很明显此时editText为null,但我无法理解为什么,或者我在本教程中遗漏的任何内容.
我的MainActivity类:
package com.example.myfirstapp;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.widget.EditText;
/**
* <p>Main Activity class for the App</p>
*
* @author - thebloodguy
*/
public class MainActivity extends Activity {
//~ ----------------------------------------------------------------------------------------------------------------
//~ Static fields/initializers
//~ ----------------------------------------------------------------------------------------------------------------
/** Key to the extra message data in the sendMessage intent */
public static …
Run Code Online (Sandbox Code Playgroud) java android nullpointerexception android-virtual-device illegalstateexception