我正在使用android/java中的Location子类序列化打砖块
位置不可序列化.我有一个名为FALocation的第一个子类,它没有任何实例变量.我已声明它可序列化.
然后我有一个名为Waypoint的第二个类看起来像这样:
public class Waypoint extends FALocation implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
/* Class variables *******************************************************/
private static int CLASS_VERSION=1; //Used to version parcels
/* Instance variables ****************************************************/
private transient String type=DataHelper.PT_TYPE_US;
private transient String country;
private transient String name=null;
private transient String description=null;
private transient int elevation = 0;
private transient int population = 0; // Afterthought, added to match the DB structure
/* Constructors **********************************************************/
public Waypoint() {
super(); …Run Code Online (Sandbox Code Playgroud) 我们设置了2个项目,1个主项目和1个子项目,它们是Java项目.它们都在同一个目录下.
以下是目录结构的外观:
./dev
./Project_A
build.gradle
settings.gradle
./Project_B
build.gradle
Run Code Online (Sandbox Code Playgroud)
Project_A包括Project_B.
Project_A settings.gradle看起来像:
includeFlat 'Project_B'
Run Code Online (Sandbox Code Playgroud)
Project_A build.gradle包含:
compile project(':Project_B')
Run Code Online (Sandbox Code Playgroud)
这个问题 Project_A从Project_B命令行(编译时错过类gradlew干净生成).看起来Project_B不属于Project-A的类路径.
这是来自gradlew clean build的(输出的一部分)在Project_A目录中运行(之后它全部是"package project_b.xy missing"和"找不到符号"(来自Project_B):
:clean
:Project_B:clean
:Project_B:compileJava
:Project_B:processResources
:Project_B:classes
:Project_B:jar UP-TO-DATE
:compileJava
...Starts erroring out here...
Run Code Online (Sandbox Code Playgroud)
我猜这是一个类路径问题,但我无法弄清楚如何解决它.
在此先感谢,JM
PS:编辑问题,因为我能够通过2个项目构建重现问题(从3开始)
我正在尝试将Google登录集成到我的应用程序中,但是我收到了一些我无法理解的错误.
我照着教程配置的一切在这里,但它不会验证我.我看到了显示我的帐户的登录面板,并且登录活动OnActivityResult触发,当查看GoogleSignInResult时,我有一个状态,其中statusCode 8没有消息.
它似乎与此有关,但有点令人困惑.
任何的想法 ?
android google-openid google-login google-oauth google-signin
我正在尝试使用Cognito,当我认为它开始没问题时,我面临的问题是(Google)令牌在1小时后过期.
当我开始使用干净的设备时,我可以注册,使用该应用程序1小时,然后一旦我需要刷新数据集,我得到并且错误地说该令牌未被授权.
有没有关于如何处理这个问题的例子?
这真的是应用程序开发人员应该做的事情吗?我期待SDK在后台管理这些东西.
是否意味着我们必须在每次数据集同步之前检查credentialsProvider.getSessionCredentitalsExpiration()?
非常感谢,JM
编辑1:添加了代码
我确实有一个SigninActivity,但只有在根本没有凭据时才会调用它,理论上只有在用户第一次登录时才会调用.
它构建如下(删除无用位).所以会发生的事情是我第一次正确验证,但由于我再也没有进入此活动,可能会遗漏一些东西.
但是必须有一种方法可以静默刷新这个令牌吗?
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.setContentView(R.layout.signin);
// Aws Credential provider
credentialsProvider = new CognitoCachingCredentialsProvider(
getApplicationContext(), // Context
getString(R.string.aws_identity_pool), // Identity Pool ID
Regions.EU_WEST_1 // Region
);
// Google connect
findViewById(R.id.signin_with_google_btn).setOnClickListener(this);
GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
.requestEmail()
.requestProfile()
.requestIdToken(getString(R.string.google_server_client_id))
.requestId()
.build();
// Build a GoogleApiClient with access to the Google Sign-In API and the
// options specified by gso.
googleApiClient = new GoogleApiClient.Builder(this)
.enableAutoManage(this, this )
.addApi(Auth.GOOGLE_SIGN_IN_API, gso)
.build(); …Run Code Online (Sandbox Code Playgroud) 我整天一直在敲打这个问题,但似乎我无法弄明白......
好的,所以我添加了一个很好并且正常工作的项目.
为了"rejuvinate"它,我决定添加操作栏与程序兼容性库(如描述在这里.
由于我添加了库,我无法再编译项目,并且我不断收到以下错误:
C:\Users\Me\Documents\Dev\MyProject\res\values\widget_attributes.xml:9: error: Attribute "title" has already been defined
Run Code Online (Sandbox Code Playgroud)
widget_attrributes.xml看起来像这样:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<attr name="display" format="string" />
<attr name="lineWidth" format="dimension" />
<attr name="lineColor" format="color|reference" />
<attr name="fillColor" format="color|reference" />
<declare-styleable name="DigitalDisplay">
<attr name="title" format="string" />
<attr name="unit" format="string" />
<attr name="display" />
<attr name="valueFormat" format="string" />
<attr name="showUnitInValue" format="boolean" />
<attr name="showUnitInTitle" format="boolean" />
<attr name="valueIsTime" format="boolean" />
<attr name="titleTxtAppearance" format = "reference" />
<attr name="valueTxtAppearance" format = "reference" />
<attr name="unitTxtAppearance" format = …Run Code Online (Sandbox Code Playgroud) 我正在寻找布局 PDF 文档的选项,该文档必须非常整洁和准确。
该文档是一种报告,并将数据显示在现有背景上。在某些情况下,文本大于其应容纳的空间。
我想将文本剪切到允许的精确区域(这不是换行或“省略”,因为文本大部分时间都是数字)。
这是我正在寻找的效果(这是一个示例,我不打算缩短字符串,我希望字符串保持不变,但实际上被剪裁到其允许的区域之外)。
谢谢,JM
android ×4
java ×2
clipping ×1
google-login ×1
google-oauth ×1
gradle ×1
pdf ×1
pdfbox ×1
subproject ×1