anonymous No title
No License Kotlin
2020年08月31日
Copy Clone
//ToolBarを置きたい画面のActivity
package com.example.send_words

import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.provider.AlarmClock
import android.widget.TextView

class DisplayMessageActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_display_message)

        val toolbar:androidx.appcompat.widget.Toolbar = findViewById(R.id.toolbar)
        setSupportActionBar(toolbar)
        supportActionBar?.setTitle("公開設定")

        supportActionBar?.setDisplayShowHomeEnabled(true)
        supportActionBar?.setDisplayHomeAsUpEnabled(true)

        //Activity開始時にIntentを取得し、文字列をセットする
        val intent: Intent = getIntent()
        val message: String? = intent.getStringExtra(AlarmClock.EXTRA_MESSAGE)
        val textView: TextView = findViewById(R.id.textView)
        textView.setText(message)
    }

    override fun onSupportNavigateUp(): Boolean {
        finish()
        return super.onSupportNavigateUp()
    }
}

//xmlファイル
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".DisplayMessageActivity">

    <TextView
        android:id="@+id/textView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="236dp"
        android:text="TextView"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.498"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <androidx.appcompat.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="#FDBD5F"
        android:gravity="center"
        android:minHeight="?attr/actionBarSize"
        android:theme="?attr/actionBarTheme"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:subtitleTextAppearance="@style/TextAppearance.AppCompat.Medium"
        app:subtitleTextColor="#FDFBFB" />

</androidx.constraintlayout.widget.ConstraintLayout>
//ToolBarを置きたい画面のActivity
package com.example.send_words

import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.provider.AlarmClock
import android.widget.TextView

class DisplayMessageActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_display_message)

        val toolbar:androidx.appcompat.widget.Toolbar = findViewById(R.id.toolbar)
        setSupportActionBar(toolbar)
        supportActionBar?.setTitle("公開設定")

        supportActionBar?.setDisplayShowHomeEnabled(true)
        supportActionBar?.setDisplayHomeAsUpEnabled(true)

        //Activity開始時にIntentを取得し、文字列をセットする
        val intent: Intent = getIntent()
        val message: String? = intent.getStringExtra(AlarmClock.EXTRA_MESSAGE)
        val textView: TextView = findViewById(R.id.textView)
        textView.setText(message)
    }

    override fun onSupportNavigateUp(): Boolean {
        finish()
        return super.onSupportNavigateUp()
    }
}

//xmlファイル
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".DisplayMessageActivity">

    <TextView
        android:id="@+id/textView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="236dp"
        android:text="TextView"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.498"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <androidx.appcompat.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="#FDBD5F"
        android:gravity="center"
        android:minHeight="?attr/actionBarSize"
        android:theme="?attr/actionBarTheme"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:subtitleTextAppearance="@style/TextAppearance.AppCompat.Medium"
        app:subtitleTextColor="#FDFBFB" />

</androidx.constraintlayout.widget.ConstraintLayout>
anonymous
Anonymous
2021年04月28日
Medicament information. What side effects can this medication cause? <a href="https://pregabalininfo.top">where to buy generic pregabalin without dr prescription</a> in the USA All about pills. Read information here.
anonymous
Anonymous
2021年04月29日
Medication prescribing information. Effects of Drug Abuse. <a href="https://toplyrica.top">buying generic lyrica pills</a> in USA Everything what you want to know about drugs. Get information now.
anonymous
Anonymous
2021年04月30日
cialis professional <a href="https://mycialistabs.com/">blue sky peptide tadalafil</a> how to get cialis prescription
anonymous
Anonymous
2021年04月30日
cialis reddit <a href="https://mycialistabs.com/">cialis dosage 40 mg</a> is generic cialis available
anonymous
Anonymous
2021年05月03日
cialis after prostate surgery <a href="https://toptadalafiltabs.com/">daily cialis</a> cialis from canada to usa
anonymous
Anonymous
2021年05月04日
cialis generic cost <a href="https://toptadalafiltabs.com/">cialis for daily use</a> cialis without a doctor prescription usa
anonymous
Anonymous
2021年05月05日
how to write a 4 page essay in one night <a href="https://topessaywriterfas.com/">good ways to start a college essay</a> how to write a structural analysis essay
anonymous
Anonymous
2021年05月05日
how to write a 250 word essay <a href="https://topessaywriterfas.com/">write my essay online</a> how to write an ap history essay
anonymous
Anonymous
2021年05月07日
essay service management <a href="http://writemyessayslfd.com/">write your essay</a> how write essay
anonymous
Anonymous
2021年05月07日
argumentative essay service <a href="http://writemyessayslfd.com/">write essays for me</a> essay theme service to others
anonymous
Anonymous
2021年05月07日
sildenafil 20 mg <a href="https://mrviagrashop.com">buy generic 100mg viagra online</a> viagra pill
anonymous
Anonymous
2021年05月07日
viagra foods <a href="https://mrviagrashop.com">lovely lilith viagra falls</a> viagra pranks
anonymous
Anonymous
2021年05月07日
buy generic 100mg viagra online <a href="https://mysildenafilkr.com/">viagra generico</a> viagra pill
anonymous
Anonymous
2021年05月08日
viagra walgreens <a href="https://mysildenafilkr.com/">women viagra</a> sildenafil cost
anonymous
Anonymous
2021年05月12日
medical assistant cover letter <a href="http://coverletterforresumetop.com/">military to civilian resume</a> best skills for resume
anonymous
Anonymous
2021年05月12日
cialis and high blood pressure <a href="http://tadalafilled.com/">how much is cialis</a> cialis medication
anonymous
Anonymous
2021年05月12日
executive resume <a href="http://coverletterforresumetop.com/">entry level resume</a> cover letter job application
anonymous
Anonymous
2021年05月12日
cialis otc <a href="http://tadalafilled.com/">cialis coupon</a> cialis half life
anonymous
Anonymous
2021年05月13日
real estate agent resume <a href="https://writingacoverletteronline.com/">writing a cv for a job</a> public relations resume
anonymous
Anonymous
2021年05月13日
resume building <a href="https://writingacoverletteronline.com/">technical resume writing services</a> customer service resume objective
anonymous
Anonymous
2021年05月14日
cheapest viagra <a href="https://edviagramaster.net/">viagra substitute</a> sildenafil 20 mg cost
anonymous
Anonymous
2021年05月14日
viagra femenino <a href="https://edviagramaster.net/">sildenafil prescription online</a> using viagra
anonymous
Anonymous
2021年05月15日
generic viagra india <a href="https://sildenafilviagratop.com">viagra government funded</a> sildenafil 20
anonymous
Anonymous
2021年05月16日
otc cialis <a href="https://cialisortadalafil.com/">tadalafil dosage</a> cialis price canada
anonymous
Anonymous
2021年05月16日
generic cialis price <a href="https://cialisortadalafil.com/">how long does cialis last 20 mg</a> cialis 20mg side effects
anonymous
Anonymous
2021年05月16日
viagra canadian pharmacy ezzz <a href="https://sildenafilviagratop.com">buy viagra</a> where to buy female viagra
anonymous
Anonymous
2021年05月17日
what doe cialis look like <a href="https://topcialistabs.com/">generic cialis canada</a> cialis price per pill
anonymous
Anonymous
2021年05月17日
cialis drug class <a href="https://topcialistabs.com/">20 mg cialis</a> cialis for men
anonymous
Anonymous
2021年06月01日
Drug information for patients. Long-Term Effects. <a href="https://prilosec4u.top">how to buy prilosec price</a> in Canada Some information about pills. Read now.