小编And*_*ewb的帖子

构造函数Intent(new View.OnClickListener(){},Class <DrinksTwitter>)未定义

我收到以下错误:

The constructor Intent(new View.OnClickListener(){}, 
                       Class<DrinksTwitter>) is undefined
Run Code Online (Sandbox Code Playgroud)

在以下代码段中:

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    // Get the EditText and Button References
    etUsername = (EditText)findViewById(R.id.username);
    etPassword = (EditText)findViewById(R.id.password);
    btnLogin = (Button)findViewById(R.id.login_button);
    btnSignUp = (Button)findViewById(R.id.signup_button);
    lblResult = (TextView)findViewById(R.id.result);

    // Set Click Listener
    btnLogin.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View v) {
            // Check Login
            String username = etUsername.getText().toString();
            String password = etPassword.getText().toString();


            if(username.equals("test") && password.equals("test")){
                final Intent i = new Intent(this, DrinksTwitter.class);  //error on this line
                startActivity(i);
                // lblResult.setText("Login …
Run Code Online (Sandbox Code Playgroud)

android android-intent

13
推荐指数
2
解决办法
2万
查看次数

MailChimp API 3.0无效的资源错误

我只是想在MailChimp列表中添加一个新成员.但我不断收到以下错误,并不能理解为什么:

type: http://developer.mailchimp.com/documentation/mailchimp/guides/error-glossary/
title: Invalid Resource
status: 400
detail: The resource submitted could not be validated. For field-specific details, see the 'errors' array.
instance:
errors:
0:
field:
message: Schema describes object, NULL found instead
Run Code Online (Sandbox Code Playgroud)

这很奇怪,因为我正在发送正文中的确切对象,详见docs中的exampled:

{"email_address":"urist.mcvankab+3@freddiesjokes.com", "status":"subscribed"}
Run Code Online (Sandbox Code Playgroud)

我在Postman以及MailChimp Playground尝试了这个电话.我在这里省略了JSON中的内容吗?

json mailchimp-api-v3.0

7
推荐指数
1
解决办法
4373
查看次数

Android设置GoolgeMap从点数据库边界

使用谷歌地图Android API v2,我试图使用LatLngBounds.Builder()数据库中的点设置地图的边界.我认为我很接近,但活动正在崩溃,因为我认为我没有正确加载积分.我可能只是几行之遥.

//setup map
private void setUpMap() {

    //get all cars from the datbase with getter method
    List<Car> K = db.getAllCars();

    //loop through cars in the database
    for (Car cn : K) {

        //add a map marker for each car, with description as the title using getter methods
        mapView.addMarker(new MarkerOptions().position(new LatLng(cn.getLatitude(), cn.getLongitude())).title(cn.getDescription()));

        //use .include to put add each point to be included in the bounds   
        bounds = new LatLngBounds.Builder().include(new LatLng(cn.getLatitude(), cn.getLongitude())).build();

       //set bounds with all the map …
Run Code Online (Sandbox Code Playgroud)

android android-maps-v2

6
推荐指数
1
解决办法
1万
查看次数