我想使用android动画在模拟器上从左到右翻译图像.我是android动画的新手.我怎么能这样做?
谢谢.
我需要创建多个状态栏通知.当我拉下状态栏时,应该将多个通知图标显示为列表.每个通知图标都应显示下一页显示的单独数据.我怎么能这样做?
我的代码:
public class SimpleNotification extends Activity {
private NotificationManager mNotificationManager;
private int SIMPLE_NOTFICATION_ID;
String str="Hai";
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
mNotificationManager = (NotificationManager)getSystemService(NOTIFICATION_SERVICE);
final Notification notifyDetails = new Notification(R.drawable.android,"New Alert, Click Me!",System.currentTimeMillis());
Button start = (Button)findViewById(R.id.notifyButton);
Button cancel = (Button)findViewById(R.id.cancelButton);
start.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
Context context = getApplicationContext();
CharSequence contentTitle = "Notification Details...";
CharSequence contentText = "Browse Android Official Site by clicking me"; …Run Code Online (Sandbox Code Playgroud) 我需要在android中使用背景颜色变化做圆形角落按钮.
我怎么能这样做?
示例链接/代码非常感谢.
我有一个动态列表视图,每行有一个文本和一个复选框.当我点击一个按钮时,我需要将所有选中的项目名称和未经检查的项目名称分别作为arraylilst.我怎么能这样做.示例更好..
我用了..
SparseBooleanArray checked = mainlw.getCheckedItemPositions();
for (int i = 0; i < checked.size(); i++) {
if(checked.valueAt(i) == true) {
Planet tag = (Planet) mainlw.getItemAtPosition(checked.keyAt(i));
String selectedName=tag.getName();
Toast.makeText(getApplicationContext(), selectedName, Toast.LENGTH_SHORT).show();
}
}
Run Code Online (Sandbox Code Playgroud) 我从数据库中获取数据并显示GridView罚款.但是我需要在每个显示的文本下方放置一个单独的按钮.当我点击按钮时,我必须做一些事情.在这里,我使用自定义列表适配器从DB中检索数据.我怎么能这样做?
我的代码:
public class HomePage extends Activity {
private ArrayList<SingleElementDetails> allElementDetails=new ArrayList<SingleElementDetails>();
DBAdapter db=new DBAdapter(this);
String category, description;
String data;
String data1;
GridView gridview;
Button menu;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.homepage);
menu=(Button)findViewById(R.id.menus);
menu.setOnClickListener(new OnClickListener() {
public void onClick(View v)
{
gridview=(GridView)findViewById(R.id.gridview);
allElementDetails.clear();
db.open();
long id;
//id=db1.insertTitle1(category, description,r_photo);
Cursor cursor = db.getAllTitles1();
while (cursor.moveToNext())
{
SingleElementDetails single=new SingleElementDetails();
single.setCateogry(cursor.getString(1));
single.setDescription(cursor.getString(2));
single.setImage(cursor.getBlob(3));
allElementDetails.add(single);
}
db.close();
CustomListAdapter adapter=new CustomListAdapter(HomePage.this,allElementDetails);
gridview.setAdapter(adapter);
}
});
}
}
Run Code Online (Sandbox Code Playgroud)
我的customListAdapter:
import java.io.ByteArrayInputStream;
import java.util.ArrayList; …Run Code Online (Sandbox Code Playgroud) 我只是想在android中的视频播放器(同时视频播放)上手动绘制圆形,矩形或其他东西.是否可能?如果任何代码示例要好得多.
谢谢.
我创建了一个facebook android应用程序.它在GSM上运行良好.当我在CDMA设备上运行时,它甚至没有登录.我找到了这个:
"谷歌停止支持CDMA设备.目前该应用仅支持在GSM网络上运行的手机.CDMA网络(例如Sprint和Verizon)手机和Torch 9800尚不兼容."
参考:http: //www.theregister.co.uk/2012/02/07/google_android_cdma/
http://www.spotify.com/int/help/faq/mobile/
那我不能在CDMA网络上运行我的应用程序吗?
我可以在android webview中显示HTML文件内容.现在我怎样才能将参数传递给HTML文件.对于ex.my HTML内容有一个视频播放器我需要将动态值(URL)传递到HTML文件中以播放动态视频.我的HTML文件位于资产文件夹中.我怎么能这样做?
谢谢.
我有一个默认的警告对话框,其中包含文本和单选按钮的列表视图.
我需要替换图像而不是文本(替换图像而不是Facebook信用卡,PayPal,下面显示的信用卡),还需要更改警报对话框的背景颜色.
我也将style.xml文件放在values文件夹中.
我如何在下面的代码中实现该文件以更改背景颜色?
我的代码:
final CharSequence[] items = {"Facebook credit", "Paypal", "Credit Card"};
//ContextThemeWrapper ctw = new ContextThemeWrapper( this, R.style.AboutDialog );
AlertDialog.Builder builder = new AlertDialog.Builder(paymentPage.this);
builder.setTitle("Payment Gateway");
builder.setIcon(R.drawable.gate);
builder.setSingleChoiceItems(items, -1, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int item) {
// Toast.makeText(getApplicationContext(), items[item], Toast.LENGTH_SHORT).show();
}
});
builder.setPositiveButton("Yes",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
payPalPayment();
}
});
builder.setNegativeButton("No",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
Toast.makeText(paymentPage.this, "Fail", Toast.LENGTH_SHORT).show();
}
});
AlertDialog alert …Run Code Online (Sandbox Code Playgroud)