我正在使用overridePendingTransition来创建我的活动并且工作正常我可以看到淡入效果非常好,但是当我尝试为活动完成动画时,它仍然是默认的向右滑动.
我在开始活动时首先尝试定义out动画,如下所示:
Intent myIntent = new Intent(a, SkdyAlert.class);
myIntent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
a.startActivity(myIntent);
if (android.os.Build.VERSION.SDK_INT > android.os.Build.VERSION_CODES.DONUT) {
AnimationHelper.overridePendingTransition(a, R.anim.fadein, R.anim.fadeout);
}
Run Code Online (Sandbox Code Playgroud)
然后我也尝试在完成活动时这样做
okBtn.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
finish();
if (android.os.Build.VERSION.SDK_INT > android.os.Build.VERSION_CODES.DONUT) {
AnimationHelper.overridePendingTransition(activity, 0, R.anim.fadeout);
}
}
});
Run Code Online (Sandbox Code Playgroud)
但这些方法都不会阻止退出动画的"从右到左"幻灯片.关于我做错了什么的任何想法?
我有一个以Google的地理围栏示例代码开头的应用.它可以工作几天,我得到了所有过渡意图,正如我预期的那样.然而,经过一段时间,比如3天,应用程序停止了这些意图,我不知道为什么.
当我创建我的围栏时,我将到期时间设置为Geofence.NEVER_EXPIRE
这是我的IntentService,我在它停止工作之前获得转换意图:
public class ReceiveTransitionsIntentService extends IntentService {
@Override
protected void onHandleIntent(Intent intent) {
Intent broadcastIntent = new Intent();
broadcastIntent.addCategory(GeofenceUtils.CATEGORY_LOCATION_SERVICES);
// First check for errors
if (LocationClient.hasError(intent)) {
...handle errors
} else {
// Get the type of transition (entry or exit)
int transition = LocationClient.getGeofenceTransition(intent);
// Test that a valid transition was reported
if ((transition == Geofence.GEOFENCE_TRANSITION_ENTER)
|| (transition == Geofence.GEOFENCE_TRANSITION_EXIT)) {
// Post a notification
NEVER GETS HERE
} else {
...log error
}
}
}
} …Run Code Online (Sandbox Code Playgroud) 我正在研究一个libGDX项目,我有一个名为CheerVArachnids的类,它有另一个内联类,它是一个事件监听器.当我在桌面上运行这个项目时它工作正常.但是当我在我的Android设备上运行时,它找不到内联类,我收到以下错误:
Could not find class 'com.bbj.cva.CheerVArachnids$PlaceUnitListener', referenced from method com.bbj.cva.CheerVArachnids.<init>
Run Code Online (Sandbox Code Playgroud)
以下是我班级的重要部分:
package com.bbj.cva;
public class CheerVArachnids implements ApplicationListener {
class PlaceUnitListener implements EventSubscriber<PlaceUnitEvent> {
@Override
public void onEvent(PlaceUnitEvent event)
{
//
}
}
public CheerVArachnids() {
EventBus.subscribe(PlaceUnitEvent.class, new PlaceUnitListener());
EventBus.subscribe(RemoveScreenObjectEvent.class,
new RemoveScreenObjectListener());
}
}
Run Code Online (Sandbox Code Playgroud)
任何想法为什么在Android上,在运行时它无法找到内联类?
尝试使用OAuth对Facebook进行身份验证时出现以下错误:
{
"error": {
"message": "Invalid redirect_uri: Given URL is not allowed by the Application configuration.",
"type": "OAuthException"
}
}
Run Code Online (Sandbox Code Playgroud)
我的网址看起来像这样:
https://graph.facebook.com/oauth/authorize?client_id=283993944973616&redirect_uri=http://dennys-m.appspot.com/fb_login/&scope=publish_stream,email&display=popup
Run Code Online (Sandbox Code Playgroud)
我知道有很多其他帖子有这个问题,但我看不出是什么会让我的网址无效.有什么想法我收到这个错误?
我有一个我正在开发的应用程序,它会为广告目的进行一些非常基本的用户跟踪.在浏览新的广告ID时,我找到了一个有趣的方法:http: //developer.android.com/reference/com/google/android/gms/ads/identifier/AdvertisingIdClient.Info.html#isLimitAdTrackingEnabled()
这种方法的文档令人难以置信地稀疏.用户如何启用有限的广告跟踪?我在Nexus 4.4上找不到任何可能会限制广告跟踪的内容.
所以我真正的问题是,我是否需要尊重这个布尔值,而不是跟踪用户是否有这个设置?我是这么认为的,但我真的很想了解更多,而且文档没有帮助.
我正在尝试保存一个对象并验证它是否立即保存,并且它似乎没有工作.
这是我的目标
import com.googlecode.objectify.annotation.Entity;
import com.googlecode.objectify.annotation.Id;
@Entity
public class PlayerGroup {
@Id public String n;//sharks
public ArrayList<String> m;//members [39393,23932932,3223]
}
Run Code Online (Sandbox Code Playgroud)
这是保存然后尝试加载的代码.
playerGroup = new PlayerGroup();
playerGroup.n = reqPlayerGroup.n;
playerGroup.m = reqPlayerGroup.m;
ofy().save().entity(playerGroup).now();
response.i = playerGroup;
PlayerGroup newOne = ofy().load().type(PlayerGroup.class).id(reqPlayerGroup.n).get();
Run Code Online (Sandbox Code Playgroud)
但是"newOne"对象为null.即使我完成了保存它.我究竟做错了什么?
- 更新 - 如果我稍后尝试(比如几分钟之后),我有时会看到对象,但保存后却没有.这与高复制存储有关吗?
我看到这篇文章如何为Android应用程序设置IntelliJ IDEA?它看起来很棒,除了我在我的机器上找不到JDK(MacBook Pro)
我知道我安装了java,从命令行我得到这个:
TheThing:android bryce$ javac -version
javac 1.6.0_15
TheThing:android bryce$ which javac
/usr/bin/javac
Run Code Online (Sandbox Code Playgroud)
但我已经尝试了一段时间,我在机器上看不到任何jdks ......有什么建议吗?
我有一个从Android ContactManager示例中获得的联系人列表视图.此列表显示正常,但我无法弄清楚如何从所选项目中获取信息,如"姓名"和"电话号码".
我可以获得所选位置,但mContactList.getItemAtPosition(position)的结果是一个ContentResolver $ CursorWrapperInner,这对我来说并没有任何意义.我无法从中得到正面或反面.
任何人都知道如何从listView中的选定项目获取名称/ ID /电话号码?
这是我的代码.
@Override
public void onCreate(Bundle savedInstanceState)
{
Log.v(TAG, "Activity State: onCreate()");
super.onCreate(savedInstanceState);
setContentView(R.layout.choose_contact);
// Obtain handles to UI objects
mAddAccountButton = (Button) findViewById(R.id.addContactButton);
mContactList = (ListView) findViewById(R.id.contactList);
mShowInvisibleControl = (CheckBox) findViewById(R.id.showInvisible);
// Initialize class properties
mShowInvisible = false;
mShowInvisibleControl.setChecked(mShowInvisible);
mContactList.setOnItemClickListener(new OnItemClickListener()
{
public void onItemClick(AdapterView<?> parent, View view, int position, long id)
{
addContactAt(position);
}
});
mShowInvisibleControl.setOnCheckedChangeListener(new OnCheckedChangeListener() {
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
Log.d(TAG, "mShowInvisibleControl changed: " + isChecked); …Run Code Online (Sandbox Code Playgroud) 我有一个纯粹的AS3应用程序,我正在部署到Android和iOS.在某些情况下,我需要屏幕关闭60秒以上.有没有办法用AIR for Mobile做到这一点?
我有一个应该看起来像附加图像的进度条:
而且我已经做了很长的路.我非常接近唯一不起作用的部分是progressDrawable的圆角.这是我的样子.(注意,用红色圈出,白色轮廓内的填充没有圆角):
所以,当进度条用形状,渐变或颜色着色时,我发现了一些方法可以使这个工作.但是,我无法通过progressDrawable获取图像.
这是我的扩展ProgressBar的类
public class RoundedProgressBar extends ProgressBar{
private Paint paint;
public RoundedProgressBar(Context context) {
super(context);
setup();
}
public RoundedProgressBar(Context context, AttributeSet attrs) {
super(context, attrs);
setup();
}
public RoundedProgressBar(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
setup(); ;
}
protected void setup()
{
paint = new Paint();
}
@Override
protected synchronized void onDraw(Canvas canvas) {
// First draw the regular progress bar, then custom draw our text
super.onDraw(canvas);
paint.setColor(Color.WHITE);
paint.setStyle(Paint.Style.STROKE);
RectF r = new RectF(0,0,getWidth()-1,getHeight()-1);
canvas.drawRoundRect(r,getHeight()/2,getHeight()/2, …Run Code Online (Sandbox Code Playgroud)