質問編集履歴
2
タグの追加
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
1
コード内容に間違いがあったので修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -448,134 +448,6 @@
|
|
448
448
|
|
449
449
|
|
450
450
|
|
451
|
-
**build.gradle(project)**
|
452
|
-
|
453
|
-
```
|
454
|
-
|
455
|
-
package com.nifty.user
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
import android.content.Intent
|
460
|
-
|
461
|
-
import android.os.Bundle
|
462
|
-
|
463
|
-
import android.support.v7.app.AppCompatActivity
|
464
|
-
|
465
|
-
import android.view.Menu
|
466
|
-
|
467
|
-
import android.view.MenuItem
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
import com.nifty.cloud.mb.core.NCMB
|
476
|
-
|
477
|
-
import com.nifty.cloud.mb.core.NCMBUser
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
class MainActivity : AppCompatActivity() {
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
override fun onCreate(savedInstanceState: Bundle?) {
|
486
|
-
|
487
|
-
super.onCreate(savedInstanceState)
|
488
|
-
|
489
|
-
setContentView(R.layout.activity_main)
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
//**************** APIキーの設定とSDKの初期化 **********************
|
494
|
-
|
495
|
-
NCMB.initialize(this.applicationContext, "7e6d6479ddc9c642f4229d2041c4a6093d2d1f45385c350543523c9b4c328e4f",
|
496
|
-
|
497
|
-
"c81eea502681d9c069ca4104b98420ff59318b07f76aeec1cca3c816bbf08e87")
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
val intent = Intent(this, LoginActivity::class.java)
|
502
|
-
|
503
|
-
startActivity(intent)
|
504
|
-
|
505
|
-
}
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
override fun onCreateOptionsMenu(menu: Menu): Boolean {
|
510
|
-
|
511
|
-
// Inflate the menu; this adds items to the action bar if it is present.
|
512
|
-
|
513
|
-
menuInflater.inflate(R.menu.menu_main, menu)
|
514
|
-
|
515
|
-
return true
|
516
|
-
|
517
|
-
}
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
522
|
-
|
523
|
-
// Handle action bar item clicks here. The action bar will
|
524
|
-
|
525
|
-
// automatically handle clicks on the Home/Up button, so long
|
526
|
-
|
527
|
-
// as you specify a parent activity in AndroidManifest.xml.
|
528
|
-
|
529
|
-
val id = item.itemId
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
if (id == R.id.action_settings) {
|
536
|
-
|
537
|
-
return true
|
538
|
-
|
539
|
-
}
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
if (id == R.id.action_logout) {
|
544
|
-
|
545
|
-
NCMBUser.logoutInBackground { e ->
|
546
|
-
|
547
|
-
if (e != null) {
|
548
|
-
|
549
|
-
//エラー時の処理
|
550
|
-
|
551
|
-
}
|
552
|
-
|
553
|
-
}
|
554
|
-
|
555
|
-
val intent = Intent(this, LoginActivity::class.java)
|
556
|
-
|
557
|
-
startActivity(intent)
|
558
|
-
|
559
|
-
return true
|
560
|
-
|
561
|
-
}
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
return super.onOptionsItemSelected(item)
|
566
|
-
|
567
|
-
}
|
568
|
-
|
569
|
-
}
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
```
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
|
579
451
|
|
580
452
|
|
581
453
|
この問題に長い時間を取られております、、、
|